Class API

API Client

Hierarchy

  • API

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • Optional __namedParameters: Partial<Options>

    Returns API

Properties

authentication: any
baseURL: any

Accessors

  • get auth(): AxiosRequestConfig<any>
  • Generate authentication options.

    Returns AxiosRequestConfig<any>

  • get config(): AxiosRequestConfig<any>
  • Generate config to pass through to API.

    Returns AxiosRequestConfig<any>

Methods

  • Send HTTP DELETE request.

    Type Parameters

    • Path extends "/auth/mfa/totp" | `/bots/${string}` | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{emoji_id}" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | "-/bots/{target}" | `/channels/${string}/messages/${string}/pin` | "-/channels/{target}/messages/{msg}/pin" | `/channels/${string}/messages/bulk` | "-/channels/{target}/messages/bulk" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/channels/${string}/messages/${string}/reactions` | "-/channels/{target}/messages/{msg}/reactions" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/auth/session/${string}` | "-/auth/session/{id}"

    • Route extends APIRoutes & {
          method: "delete";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • Optional params: any

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP DELETE request.

    Type Parameters

    • Path extends "/auth/mfa/totp" | `/bots/${string}` | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{emoji_id}" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | "-/bots/{target}" | `/channels/${string}/messages/${string}/pin` | "-/channels/{target}/messages/{msg}/pin" | `/channels/${string}/recipients/${string}` | "-/channels/{target}/recipients/{member}" | `/channels/${string}/messages/${string}/reactions` | "-/channels/{target}/messages/{msg}/reactions" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/auth/session/${string}` | "-/auth/session/{id}"

    • Route extends APIRoutes & {
          method: "delete";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • Optional params: any

      Body or Query Parameters

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP GET request.

    Type Parameters

    • Path extends "/auth/session/all" | "/" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | "-/users/{target}/profile" | `/users/${string}/dm` | "-/users/{target}/dm" | `/users/${string}/mutual` | "-/users/{target}/mutual" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{bot}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/channels/${string}/webhooks` | "-/channels/{channel_id}/webhooks" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{emoji_id}" | "/auth/account/" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members` | "-/servers/{target}/members" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | `/servers/${string}/members_experimental_query` | "-/servers/{target}/members_experimental_query"

    • Route extends APIRoutes & {
          method: "get";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP GET request.

    Type Parameters

    • Path extends "/auth/session/all" | "/" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | "-/users/{target}/profile" | `/users/${string}/dm` | "-/users/{target}/dm" | `/users/${string}/mutual` | "-/users/{target}/mutual" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{bot}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/channels/${string}/webhooks` | "-/channels/{channel_id}/webhooks" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{emoji_id}" | "/auth/account/" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads"

    • Route extends APIRoutes & {
          method: "get";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP PATCH request.

    Type Parameters

    • Path extends "/auth/account/change/password" | "/auth/account/change/email" | "/auth/account/reset_password" | `/users/${string}` | "-/users/{target}" | `/bots/${string}` | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | "-/bots/{target}" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/members/${string}` | "-/servers/{server}/members/{target}" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/recovery"

    • Route extends APIRoutes & {
          method: "patch";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP PATCH request.

    Type Parameters

    • Path extends "/auth/mfa/recovery"

    • Route extends Object

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP POST request.

    Type Parameters

    • Path extends "/users/friend" | "/bots/create" | "/channels/create" | "/servers/create" | "/safety/report" | "/auth/account/create" | "/auth/account/reverify" | "/auth/account/delete" | "/auth/account/reset_password" | "/auth/session/login" | "/auth/mfa/totp" | "/onboard/complete" | "/push/subscribe" | "/sync/settings/fetch" | "/sync/settings/set" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/channels/${string}/webhooks` | `/invites/${string}` | "-/invites/{target}" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/channels/${string}/search` | "-/channels/{target}/search" | `/channels/${string}/messages/${string}/pin` | "-/channels/{target}/messages/{msg}/pin" | `/channels/${string}/join_call` | "-/channels/{target}/join_call" | "-/channels/{target}/webhooks" | `/servers/${string}/channels` | "-/servers/{server}/channels" | `/servers/${string}/roles` | "-/servers/{target}/roles" | "/auth/account/disable" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | "/auth/session/logout" | "/auth/mfa/recovery" | "/push/unsubscribe"

    • Route extends APIRoutes & {
          method: "post";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP POST request.

    Type Parameters

    • Path extends "/auth/account/delete" | "/auth/mfa/totp" | `/invites/${string}` | "-/invites/{target}" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/messages/${string}/pin` | "-/channels/{target}/messages/{msg}/pin" | `/channels/${string}/join_call` | "-/channels/{target}/join_call" | "/auth/account/disable" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | "/auth/session/logout" | "/auth/mfa/recovery" | "/push/unsubscribe"

    • Route extends APIRoutes & {
          method: "post";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP PUT request.

    Type Parameters

    • Path extends "/auth/account/delete" | "/auth/mfa/ticket" | "/auth/mfa/totp" | `/custom/emoji/${string}` | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}/recipients/${string}` | "-/channels/{group_id}/recipients/{member_id}" | `/channels/${string}/permissions/${string}` | "-/channels/{target}/permissions/{role_id}" | `/channels/${string}/permissions/default` | "-/channels/{target}/permissions/default" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/servers/${string}/ack` | "-/servers/{target}/ack" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/servers/${string}/permissions/${string}` | "-/servers/{target}/permissions/{role_id}" | `/servers/${string}/permissions/default` | "-/servers/{target}/permissions/default" | "-/custom/emoji/{id}"

    • Route extends APIRoutes & {
          method: "put";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send HTTP PUT request.

    Type Parameters

    • Path extends `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}/recipients/${string}` | "-/channels/{group_id}/recipients/{member_id}" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/servers/${string}/ack` | "-/servers/{target}/ack"

    • Route extends APIRoutes & {
          method: "put";
      } & {
          parts: Count<Path, "/", []>;
          path: Path;
      }

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

    Typed Response Data

  • Send any arbitrary request.

    Type Parameters

    • Method extends "get" | "patch" | "put" | "delete" | "post"

    • Routes extends PickRoutes<Method>

    • Path extends "/safety/report" | "/auth/account/create" | "/auth/account/reverify" | "/auth/account/delete" | "/auth/account/change/password" | "/auth/account/change/email" | "/auth/account/reset_password" | "/auth/mfa/ticket" | "/auth/mfa/totp" | "/onboard/complete" | "/push/subscribe" | "/sync/settings/fetch" | "/sync/settings/set" | "/" | `/users/${string}` | "-/users/{target}" | `/users/${string}/flags` | "-/users/{target}/flags" | `/users/${string}/default_avatar` | "-/users/{target}/default_avatar" | `/users/${string}/profile` | "-/users/{target}/profile" | `/users/${string}/dm` | "-/users/{target}/dm" | `/users/${string}/mutual` | "-/users/{target}/mutual" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{bot}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/channels/${string}/webhooks` | "-/channels/{channel_id}/webhooks" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{emoji_id}" | "/auth/account/" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | "-/bots/{target}" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/channels/${string}/search` | "-/channels/{target}/search" | `/channels/${string}/messages/${string}/pin` | "-/channels/{target}/messages/{msg}/pin" | `/channels/${string}/messages/bulk` | "-/channels/{target}/messages/bulk" | `/channels/${string}/recipients/${string}` | "-/channels/{group_id}/recipients/{member_id}" | "-/channels/{target}/recipients/{member}" | `/channels/${string}/join_call` | "-/channels/{target}/join_call" | `/channels/${string}/permissions/${string}` | "-/channels/{target}/permissions/{role_id}" | `/channels/${string}/permissions/default` | "-/channels/{target}/permissions/default" | `/channels/${string}/messages/${string}/reactions/${string}` | "-/channels/{target}/messages/{msg}/reactions/{emoji}" | `/channels/${string}/messages/${string}/reactions` | "-/channels/{target}/messages/{msg}/reactions" | "-/channels/{target}/webhooks" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/ack` | "-/servers/{target}/ack" | `/servers/${string}/channels` | "-/servers/{server}/channels" | `/servers/${string}/members` | "-/servers/{target}/members" | `/servers/${string}/members/${string}` | "-/servers/{target}/members/{member}" | "-/servers/{server}/members/{target}" | `/servers/${string}/members_experimental_query` | "-/servers/{target}/members_experimental_query" | `/servers/${string}/bans/${string}` | "-/servers/{server}/bans/{target}" | `/servers/${string}/roles` | "-/servers/{target}/roles" | `/servers/${string}/permissions/${string}` | "-/servers/{target}/permissions/{role_id}" | `/servers/${string}/permissions/default` | "-/servers/{target}/permissions/default" | "-/custom/emoji/{id}" | "/auth/account/disable" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/recovery" | "/push/unsubscribe"

    • Route extends Object

    Parameters

    • method: Method

      HTTP Method

    • path: Path

      Path

    • params: Route["params"]

      Body or Query Parameters

    • Optional config: AxiosRequestConfig<any>

      Axios configuration

    Returns Promise<Route["response"]>

    Typed Response Data

Generated using TypeDoc