From 911093af8755e9d720ff12f442229c325b25d005 Mon Sep 17 00:00:00 2001 From: thiagola92 Date: Tue, 29 Apr 2025 12:30:30 -0300 Subject: [PATCH] Fix Social SDK examples from Direct Messages and Friend List --- .../creating-a-unified-friends-list.mdx | 11 +++++++---- .../development-guides/sending-direct-messages.mdx | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/discord-social-sdk/development-guides/creating-a-unified-friends-list.mdx b/docs/discord-social-sdk/development-guides/creating-a-unified-friends-list.mdx index b0b46e867f..033cbf42ad 100644 --- a/docs/discord-social-sdk/development-guides/creating-a-unified-friends-list.mdx +++ b/docs/discord-social-sdk/development-guides/creating-a-unified-friends-list.mdx @@ -109,8 +109,8 @@ client->SetStatusChangedCallback([client](discordpp::Client::Status status, disc std::cout << "✅ Client is ready! You can now call SDK functions.\n"; std::cout << "👥 Friends Count: " << client->GetRelationships().size() << std::endl; - SetRichPresence(*client); - DisplayFriendsList(*client); + SetRichPresence(client); + DisplayFriendsList(client); } else if (error != discordpp::Client::Error::None) { std::cerr << "❌ Connection Error: " << discordpp::Client::ErrorToString(error) << " - Details: " << errorDetail << std::endl; @@ -142,7 +142,7 @@ This example is for reference only. Please make sure you use efficient data stru ::: ```cpp -void DisplayFriendsList(discordpp::Client& client) { +void DisplayFriendsList(std::shared_ptr client) { // Create vectors for each section std::vector inGame; std::vector online; @@ -180,7 +180,10 @@ void DisplayFriendsList(discordpp::Client& client) { } // Categorize based on status - if (user->Status() != discordpp::StatusType::Offline) { + if (user->GameActivity()) { + // in game + inGame.push_back("🟣 " + str); + } else if (user->Status() != discordpp::StatusType::Offline) { // online online.push_back("🟢 " + str); } else { diff --git a/docs/discord-social-sdk/development-guides/sending-direct-messages.mdx b/docs/discord-social-sdk/development-guides/sending-direct-messages.mdx index 3360ecaf8c..4b45072630 100644 --- a/docs/discord-social-sdk/development-guides/sending-direct-messages.mdx +++ b/docs/discord-social-sdk/development-guides/sending-direct-messages.mdx @@ -51,7 +51,7 @@ client->SendUserMessage(recipientId, message, [](auto result, uint64_t messageId if (result.Successful()) { std::cout << "✅ Message sent successfully\n"; } else { - std::cout << "❌ Failed to send message: " << result.GetError() << "\n"; + std::cout << "❌ Failed to send message: " << result.Error() << "\n"; } }); ```