Browse Source

added a GetTokenAsync method that calls the Api method, and transform the raw Api Token to a RestToken.

pull/1806/head
emorell96 4 years ago
parent
commit
b4057669fa
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.Rest/ClientHelper.cs

+ 5
- 0
src/Discord.Net.Rest/ClientHelper.cs View File

@@ -16,6 +16,11 @@ namespace Discord.Rest
var model = await client.ApiClient.GetMyApplicationAsync(options).ConfigureAwait(false);
return RestApplication.Create(client, model);
}
public static async Task<RestToken> GetTokenAsync(BaseDiscordClient client, TokenType tokenType, string token, string redirectUrl, IEnumerable<string> scopes, RequestOptions options)
{
var model = await client.ApiClient.GetTokenAsync(tokenType, token, redirectUrl, scopes, options).ConfigureAwait(false);
return RestToken.Create(client, model);
}

public static async Task<RestChannel> GetChannelAsync(BaseDiscordClient client,
ulong id, RequestOptions options)


Loading…
Cancel
Save