Skip to content

Commit 7f99239

Browse files
authored
Fix Social SDK examples from Direct Messages and Friend List (#7532)
1 parent ae6c8be commit 7f99239

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

docs/discord-social-sdk/development-guides/creating-a-unified-friends-list.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ client->SetStatusChangedCallback([client](discordpp::Client::Status status, disc
109109
std::cout << "✅ Client is ready! You can now call SDK functions.\n";
110110
std::cout << "👥 Friends Count: " << client->GetRelationships().size() << std::endl;
111111
112-
SetRichPresence(*client);
113-
DisplayFriendsList(*client);
112+
SetRichPresence(client);
113+
DisplayFriendsList(client);
114114
115115
} else if (error != discordpp::Client::Error::None) {
116116
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
142142
:::
143143

144144
```cpp
145-
void DisplayFriendsList(discordpp::Client& client) {
145+
void DisplayFriendsList(std::shared_ptr<discordpp::Client> client) {
146146
// Create vectors for each section
147147
std::vector<std::string> inGame;
148148
std::vector<std::string> online;
@@ -180,7 +180,10 @@ void DisplayFriendsList(discordpp::Client& client) {
180180
}
181181

182182
// Categorize based on status
183-
if (user->Status() != discordpp::StatusType::Offline) {
183+
if (user->GameActivity()) {
184+
// in game
185+
inGame.push_back("🟣 " + str);
186+
} else if (user->Status() != discordpp::StatusType::Offline) {
184187
// online
185188
online.push_back("🟢 " + str);
186189
} else {

docs/discord-social-sdk/development-guides/sending-direct-messages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ client->SendUserMessage(recipientId, message, [](auto result, uint64_t messageId
5151
if (result.Successful()) {
5252
std::cout << "✅ Message sent successfully\n";
5353
} else {
54-
std::cout << "❌ Failed to send message: " << result.GetError() << "\n";
54+
std::cout << "❌ Failed to send message: " << result.Error() << "\n";
5555
}
5656
});
5757
```

0 commit comments

Comments
 (0)