Skip to content

Commit

Permalink
Fix callback vs normal return example
Browse files Browse the repository at this point in the history
- That function was not a callback
- Added real callback example
  • Loading branch information
msciotti committed May 28, 2019
1 parent c7a97b4 commit d0f67d5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/game_sdk/Discord.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0f67d5

Please sign in to comment.