export declare class OAuth2API
export declare class OAuth2API
No summary provided.
constructor(rest)
Constructs a new instance of the
OAuth2API
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
generateAuthorizationURL(options)
:
string
Creates an OAuth2 authorization URL given the options
Name | Type | Optional | Description |
---|---|---|---|
options | RESTOAuth2AuthorizationQuery | No | The options for creating the authorization URL |
getCurrentAuthorizationInformation({ signal }?)
:
Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>
Fetches the current authorization information
Name | Type | Optional | Description |
---|---|---|---|
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getCurrentBotApplicationInformation({ signal }?)
:
Promise<RESTGetAPIOAuth2CurrentApplicationResult>
Fetches the current bot's application information
Name | Type | Optional | Description |
---|---|---|---|
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getToken(body, { signal }?)
:
Promise<import("discord-api-types/v10").RESTOAuth2ImplicitAuthorizationURLFragmentResult>
Fetches the bearer token for the current application
Remarks
This is primarily used for testing purposesName | Type | Optional | Description |
---|---|---|---|
body | RESTPostOAuth2ClientCredentialsURLEncodedData | No | The options for the client credentials grant request |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
refreshToken(body, { signal }?)
:
Promise<RESTPostOAuth2AccessTokenResult>
Refreshes an OAuth2 access token, giving you a new one
Name | Type | Optional | Description |
---|---|---|---|
body | RESTPostOAuth2RefreshTokenURLEncodedData | No | The options for the refresh token request |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
tokenExchange(body, { signal }?)
:
Promise<RESTPostOAuth2AccessTokenResult>
Performs an OAuth2 token exchange, giving you an access token
Name | Type | Optional | Description |
---|---|---|---|
body | RESTPostOAuth2AccessTokenURLEncodedData | No | The body of the token exchange request |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |