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.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/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}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/totp" | `/webhooks/${string}/${string}` | "-/webhooks/{webhook_id}/{token}" | `/webhooks/${string}` | "-/webhooks/{webhook_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"]>

  • Send HTTP DELETE request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/bots/${string}` | "-/bots/{target}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/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}" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/totp" | `/webhooks/${string}/${string}` | "-/webhooks/{webhook_id}/{token}" | `/webhooks/${string}` | "-/webhooks/{webhook_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"]>

  • Send HTTP GET request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/" | "/admin/stats" | `/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` | "-/channels/{target}/messages" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/channels/${string}/webhooks` | "-/channels/{channel_id}/webhooks" | `/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" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | "/auth/account/" | "/auth/session/all" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads" | `/webhooks/${string}/${string}` | "-/webhooks/{webhook_id}/{token}" | `/webhooks/${string}` | "-/webhooks/{webhook_id}"

    • 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"]>

  • Send HTTP GET request.

    Returns

    Typed Response Data

    Type Parameters

    • Path extends "/" | "/admin/stats" | `/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` | "-/channels/{target}/messages" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/channels/${string}/webhooks` | "-/channels/{channel_id}/webhooks" | `/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" | `/servers/${string}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | "/auth/account/" | "/auth/session/all" | "/auth/mfa/" | "/auth/mfa/methods" | "/onboard/hello" | "/sync/unreads" | `/webhooks/${string}/${string}` | "-/webhooks/{webhook_id}/{token}" | `/webhooks/${string}` | "-/webhooks/{webhook_id}"

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

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send HTTP PATCH request.

    Returns

    Typed Response Data

    Type Parameters

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

    • 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"]>

  • Send HTTP PATCH request.

    Returns

    Typed Response Data

    Type Parameters

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

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

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send HTTP POST request.

    Returns

    Typed Response Data

    Type Parameters

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

    • 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"]>

  • Send HTTP POST request.

    Returns

    Typed Response Data

    Type Parameters

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

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

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send HTTP PUT request.

    Returns

    Typed Response Data

    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/{target}/recipients/{member}" | `/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/${string}` | "-/custom/emoji/{id}" | "/auth/account/delete" | "/auth/mfa/ticket" | "/auth/mfa/totp"

    • 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"]>

  • Send HTTP PUT request.

    Returns

    Typed Response Data

    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/{target}/recipients/{member}" | `/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/${string}` | "-/custom/emoji/{id}" | "/auth/account/delete" | "/auth/mfa/ticket" | "/auth/mfa/totp"

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

    Parameters

    • path: Path

      Path

    Returns Promise<Route["response"]>

  • Send any arbitrary request.

    Returns

    Typed Response Data

    Type Parameters

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

    • Routes extends PickRoutes<Method>

    • Path extends "/" | "/admin/stats" | `/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" | `/users/${string}/friend` | "-/users/{target}/friend" | `/users/${string}/block` | "-/users/{target}/block" | `/bots/${string}/invite` | "-/bots/{target}/invite" | `/bots/${string}` | "-/bots/{bot}" | "-/bots/{target}" | `/channels/${string}/ack/${string}` | "-/channels/{target}/ack/{message}" | `/channels/${string}` | "-/channels/{target}" | `/channels/${string}/members` | "-/channels/{target}/members" | `/channels/${string}/invites` | "-/channels/{target}/invites" | `/channels/${string}/messages` | "-/channels/{target}/messages" | `/channels/${string}/search` | "-/channels/{target}/search" | `/channels/${string}/messages/stale` | "-/channels/{_target}/messages/stale" | `/channels/${string}/messages/${string}` | "-/channels/{target}/messages/{msg}" | `/channels/${string}/messages/bulk` | "-/channels/{target}/messages/bulk" | `/channels/${string}/recipients/${string}` | "-/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/${string}/webhooks` | "-/channels/{target}/webhooks" | "-/channels/{channel_id}/webhooks" | `/servers/${string}` | "-/servers/{target}" | `/servers/${string}/ack` | "-/servers/{target}/ack" | `/servers/${string}/channels` | "-/servers/{target}/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}/bans` | "-/servers/{target}/bans" | `/servers/${string}/invites` | "-/servers/{target}/invites" | `/servers/${string}/roles` | "-/servers/{target}/roles" | `/servers/${string}/roles/${string}` | "-/servers/{target}/roles/{role_id}" | `/servers/${string}/permissions/${string}` | "-/servers/{target}/permissions/{role_id}" | `/servers/${string}/permissions/default` | "-/servers/{target}/permissions/default" | `/servers/${string}/emojis` | "-/servers/{target}/emojis" | `/invites/${string}` | "-/invites/{target}" | `/custom/emoji/${string}` | "-/custom/emoji/{id}" | "/safety/report" | "/auth/account/create" | "/auth/account/reverify" | "/auth/account/delete" | "/auth/account/" | "/auth/account/disable" | "/auth/account/change/password" | "/auth/account/change/email" | `/auth/account/verify/${string}` | "-/auth/account/verify/{code}" | "/auth/account/reset_password" | `/auth/session/${string}` | "-/auth/session/{id}" | "/auth/mfa/ticket" | "/auth/mfa/" | "/auth/mfa/recovery" | "/auth/mfa/methods" | "/auth/mfa/totp" | "/onboard/hello" | "/onboard/complete" | "/push/subscribe" | "/push/unsubscribe" | "/sync/settings/fetch" | "/sync/settings/set" | "/sync/unreads" | `/webhooks/${string}/${string}` | "-/webhooks/{webhook_id}/{token}" | `/webhooks/${string}` | "-/webhooks/{webhook_id}" | `/webhooks/${string}/${string}/github` | "-/webhooks/{webhook_id}/{token}/github"

    • 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"]>