From d0f67d56d94c89e48cb80ae142580557fadaa6c3 Mon Sep 17 00:00:00 2001 From: msciotti Date: Tue, 28 May 2019 15:03:35 -0700 Subject: [PATCH] Fix callback vs normal return example - That function was not a callback - Added real callback example --- docs/game_sdk/Discord.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/game_sdk/Discord.md b/docs/game_sdk/Discord.md index e4509fc0d8..74b3596b76 100644 --- a/docs/game_sdk/Discord.md +++ b/docs/game_sdk/Discord.md @@ -33,14 +33,20 @@ A quick example with our C# binding: ```c# var userManager = discord.GetUserManager(); -userManager.GetCurrentUser((result, currentUser) => + +// Return via callback +userManager.GetUser(290926444748734465, (Discord.Result result, ref Discord.User otherUser) => { - if (result == Discord.Result.OK) + if (result == Discord.Result.Ok) { - Console.WriteLine(currentUser.username); - Console.WriteLine(currentUser.ID); + Console.WriteLine(otherUser.Username); + Console.WriteLine(otherUser.Id); } }); + +// Return normally +var currentUser = userManager.GetCurrentUser(); +Console.WriteLine(currentUser.Id); ``` ## Environment Variables