Skip to content

Commit 917bc42

Browse files
committed
Fix Social SDK leaving lobby
1 parent 7629dee commit 917bc42

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/discord-social-sdk/development-guides/managing-lobbies.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ client->CreateOrJoinLobby("your-unique-lobby-secret",[client](discordpp::ClientR
9292
To remove a user from a lobby, use the [`Client::LeaveLobby`] function. Only lobbies created with [`Client::CreateOrJoinLobby`] can be left using [`Client::LeaveLobby`].
9393
9494
```cpp
95+
uint64_t lobbyId = 01234567890;
96+
9597
// Leaving a lobby from the client
96-
client->LeaveLobby(01234567890, [](discordpp::ClientResult result, uint64_t lobbyId) {
98+
client->LeaveLobby(lobbyId, [&](discordpp::ClientResult result) {
9799
if(result.Successful()) {
98100
std::cout << "🎮 Left lobby successfully! Lobby Id: " << lobbyId << std::endl;
99101
} else {
@@ -121,7 +123,9 @@ Once you have a lobby created, lobby members can send messages to it using the [
121123
Clients can send messages to lobbies they are members of regardless of whether they joined the lobby using the client or server-side method.
122124

123125
```cpp
124-
client->SendLobbyMessage(01234567890, "Hello", [](discordpp::ClientResult result, uint64_t messageId) {
126+
uint64_t lobbyId = 01234567890;
127+
128+
client->SendLobbyMessage(lobbyId, "Hello", [](discordpp::ClientResult result, uint64_t messageId) {
125129
if(result.Successful()) {
126130
std::cout << "📨 Message sent successfully!\n";
127131
} else {

0 commit comments

Comments
 (0)