Add rpcToken to DiscordRpcClient.AuthorizeAsync

This commit is contained in:
RogueException
2016-07-28 21:43:46 -03:00
parent 70ad0f9a66
commit 0fc771cc5c
2 changed files with 4 additions and 4 deletions

View File

@@ -236,7 +236,7 @@ namespace Discord.API
//Rpc
public async Task<AuthenticateResponse> SendAuthenticateAsync(RequestOptions options = null)
{
var msg = new AuthenticateParams()
var msg = new AuthenticateParams
{
AccessToken = _authToken
};
@@ -244,7 +244,7 @@ namespace Discord.API
}
public async Task<AuthorizeResponse> SendAuthorizeAsync(string[] scopes, string rpcToken = null, RequestOptions options = null)
{
var msg = new AuthorizeParams()
var msg = new AuthorizeParams
{
ClientId = _clientId,
Scopes = scopes,

View File

@@ -220,10 +220,10 @@ namespace Discord
}
}
public async Task<string> AuthorizeAsync(string[] scopes)
public async Task<string> AuthorizeAsync(string[] scopes, string rpcToken = null)
{
await ConnectAsync(true).ConfigureAwait(false);
var result = await ApiClient.SendAuthorizeAsync(scopes).ConfigureAwait(false);
var result = await ApiClient.SendAuthorizeAsync(scopes, rpcToken).ConfigureAwait(false);
await DisconnectAsync().ConfigureAwait(false);
return result.Code;
}