Client

DiscordClient

class discord_limits.DiscordClient(token, token_type='bot', api_version=10, suppress_warnings=False, max_attempts=3)
Parameters:
  • token (str) – The token to use for the request.

  • token_type (str, optional) – The type of token provided (‘bot’, ‘bearer’, ‘user’, None), by default ‘bot’

  • api_version (int, optional) – The Discord API version to use (6, 7, 8, 9, 10), by default 10

token

The token to use for the request.

Type:

str

token_type

The type of token provided. Can be ‘bot’, ‘bearer’ or ‘user’.

Type:

str

api_version

The Discord API version to use. Default is 10.

Type:

int

suppress_warnings

Whether to suppress warnings or not. Default is False.

Type:

bool

max_attempts

The maximum number of attempts to make a request. Default is 3.

Type:

int

async application_info()

Get the application info.

Returns:

An application object.

Return type:

ClientResponse

async authorisation_info(bearer_token)

Get the authorisation info.

Parameters:

bearer_token (str) – The bearer token to get the authorisation info for.

Returns:

The response from Discord.

Return type:

ClientResponse

async get_bot_gateway()

Get the gateway URL for a bot.

Returns:

The response from Discord.

Return type:

ClientResponse

async get_gateway()

Get the gateway URL.

Returns:

The response from Discord.

Return type:

ClientResponse

async list_voice_regions()

Get a list of voice regions.

Returns:

A list of voice region objects.

Return type:

ClientResponse

application

The application paths.

Type:

ApplicationPaths

audit_logs

The audit log paths.

Type:

AuditPaths

auto_moderation

The auto moderation paths

Type:

AutoModerationPaths

channel

The channel paths.

Type:

ChannelPaths

emoji

The emoji paths.

Type:

EmojiPaths

guild

The guild paths.

Type:

GuildPaths

interactions

The interactions paths

Type:

InteractionsPaths

invite

The invite paths.

Type:

InvitePaths

stage

The stage paths.

Type:

StagePaths

sticker

The sticker paths.

Type:

StickerPaths

user

The users paths.

Type:

UserPaths

webhook

The webhook paths.

Type:

WebhookPaths

set_new_token(token, token_type='bot')

Set a new token to use.

Parameters:
  • token (str) – The new token to use for the request.

  • token_type (str, optional) – The type of token provided (‘bot’, ‘bearer’, ‘user’, None), by default ‘bot’