Search...

OAuth2API

export declare class OAuth2API 
export declare class OAuth2API 

No summary provided.

constructor(rest)

Constructs a new instance of the OAuth2API class
NameTypeOptionalDescription
restRESTNoNone

generateAuthorizationURL(options)

:

string

NameTypeOptionalDescription
optionsRESTOAuth2AuthorizationQueryNoThe options for creating the authorization URL

getCurrentAuthorizationInformation({ signal }?)

:

Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>

NameTypeOptionalDescription
{ signal }Pick<RequestData, 'signal'>YesNone

getCurrentBotApplicationInformation({ signal }?)

:

Promise<RESTGetAPIOAuth2CurrentApplicationResult>

NameTypeOptionalDescription
{ signal }Pick<RequestData, 'signal'>YesNone

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 purposes
NameTypeOptionalDescription
bodyRESTPostOAuth2ClientCredentialsURLEncodedDataNoThe options for the client credentials grant request
{ signal }Pick<RequestData, 'signal'>YesNone

refreshToken(body, { signal }?)

:

Promise<RESTPostOAuth2AccessTokenResult>

NameTypeOptionalDescription
bodyRESTPostOAuth2RefreshTokenURLEncodedDataNoThe options for the refresh token request
{ signal }Pick<RequestData, 'signal'>YesNone

tokenExchange(body, { signal }?)

:

Promise<RESTPostOAuth2AccessTokenResult>

NameTypeOptionalDescription
bodyRESTPostOAuth2AccessTokenURLEncodedDataNoThe body of the token exchange request
{ signal }Pick<RequestData, 'signal'>YesNone