Add rpcToken to DiscordRpcClient.AuthorizeAsync
This commit is contained in:
@@ -236,7 +236,7 @@ namespace Discord.API
|
|||||||
//Rpc
|
//Rpc
|
||||||
public async Task<AuthenticateResponse> SendAuthenticateAsync(RequestOptions options = null)
|
public async Task<AuthenticateResponse> SendAuthenticateAsync(RequestOptions options = null)
|
||||||
{
|
{
|
||||||
var msg = new AuthenticateParams()
|
var msg = new AuthenticateParams
|
||||||
{
|
{
|
||||||
AccessToken = _authToken
|
AccessToken = _authToken
|
||||||
};
|
};
|
||||||
@@ -244,7 +244,7 @@ namespace Discord.API
|
|||||||
}
|
}
|
||||||
public async Task<AuthorizeResponse> SendAuthorizeAsync(string[] scopes, string rpcToken = null, RequestOptions options = null)
|
public async Task<AuthorizeResponse> SendAuthorizeAsync(string[] scopes, string rpcToken = null, RequestOptions options = null)
|
||||||
{
|
{
|
||||||
var msg = new AuthorizeParams()
|
var msg = new AuthorizeParams
|
||||||
{
|
{
|
||||||
ClientId = _clientId,
|
ClientId = _clientId,
|
||||||
Scopes = scopes,
|
Scopes = scopes,
|
||||||
|
|||||||
@@ -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);
|
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);
|
await DisconnectAsync().ConfigureAwait(false);
|
||||||
return result.Code;
|
return result.Code;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user