Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

Hierarchy

  • Client

Index

Constructors

constructor

Properties

Private baseURL

baseURL: string = "https://discord.com/api/"

Private options

options: ClientOptions

Accessors

authCodeLink

  • get authCodeLink(): { state: string; url: string }
  • Generates a authorization code link depending on the scopes and redirect URI set.

    Returns { state: string; url: string }

    • state: string
    • url: string

Methods

getAccess

  • getAccess(code: string): Promise<string>
  • Gets the access token for the user to perform further functions.

    Parameters

    • code: string

    Returns Promise<string>

Private getAccessKey

  • getAccessKey(key: string): { access_token: any; refresh_token: any; token_type: any }
  • Parameters

    • key: string

    Returns { access_token: any; refresh_token: any; token_type: any }

    • access_token: any
    • refresh_token: any
    • token_type: any

getConnections

  • getConnections(key: string): Promise<Collection<string, Connection>>
  • Gets the connected third-party accounts of an authorized user.

    Parameters

    • key: string

    Returns Promise<Collection<string, Connection>>

getGuilds

  • getGuilds(key: string): Promise<Collection<string, Guild>>
  • Gets the guilds of an authorized user.

    Parameters

    • key: string

    Returns Promise<Collection<string, Guild>>

getUser

  • getUser(key: string): Promise<User>
  • Gets the user who has authorized using the OAuth2 flow.

    Parameters

    • key: string

    Returns Promise<User>

refreshToken

  • refreshToken(key: string): Promise<string | void>
  • Gets a new access token for the user whose access token has expired.

    Parameters

    • key: string

    Returns Promise<string | void>

Generated using TypeDoc