Search...

OAuth2API

No summary provided.
declare class OAuth2API 
declare class OAuth2API 

constructor(rest)

Constructs a new instance of the OAuth2API class
NameTypeOptionalDescription
restRESTNoNone

generateAuthorizationURL(options)

:

string

Creates an OAuth2 authorization URL given the options
NameTypeOptionalDescription
optionsRESTOAuth2AuthorizationQueryNoThe options for creating the authorization URL

getCurrentAuthorizationInformation()

:

Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>

Fetches the current authorization information

getCurrentBotApplicationInformation()

:

Promise<RESTGetAPIOAuth2CurrentApplicationResult>

Fetches the current bot's application information

getToken(options)

:

Promise<discord_api_types_v10.RESTOAuth2ImplicitAuthorizationURLFragmentResult>

Fetches the bearer token for the current application
Remarks
This is primarily used for testing purposes
NameTypeOptionalDescription
optionsRESTPostOAuth2ClientCredentialsURLEncodedDataNoThe options for the client credentials grant request

refreshToken(options)

:

Promise<RESTPostOAuth2AccessTokenResult>

Refreshes an OAuth2 access token, giving you a new one
NameTypeOptionalDescription
optionsRESTPostOAuth2RefreshTokenURLEncodedDataNoThe options for the refresh token request

tokenExchange(options)

:

Promise<RESTPostOAuth2AccessTokenResult>

Performs an OAuth2 token exchange, giving you an access token
NameTypeOptionalDescription
optionsRESTPostOAuth2AccessTokenURLEncodedDataNoThe options for the token exchange request