Browse Source

Update DiscordRestClient.cs

pull/2071/head
quin lynch 3 years ago
parent
commit
c083a19b64
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/Discord.Net.Rest/DiscordRestClient.cs

+ 6
- 2
src/Discord.Net.Rest/DiscordRestClient.cs View File

@@ -59,10 +59,14 @@ namespace Discord.Rest
internal override async Task OnLoginAsync(TokenType tokenType, string token)
{
var user = await ApiClient.GetMyUserAsync(new RequestOptions { RetryMode = RetryMode.AlwaysRetry }).ConfigureAwait(false);
await GetApplicationInfoAsync(new RequestOptions { RetryMode = RetryMode.AlwaysRetry }).ConfigureAwait(false);
ApiClient.CurrentUserId = user.Id;
ApiClient.CurrentApplicationId = _applicationInfo.Id;
base.CurrentUser = RestSelfUser.Create(this, user);

if(tokenType == TokenType.Bot)
{
await GetApplicationInfoAsync(new RequestOptions { RetryMode = RetryMode.AlwaysRetry }).ConfigureAwait(false);
ApiClient.CurrentApplicationId = _applicationInfo.Id;
}
}

internal void CreateRestSelfUser(API.User user)


Loading…
Cancel
Save