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:
- audit_logs
The audit log paths.
- Type:
- auto_moderation
The auto moderation paths
- Type:
- channel
The channel paths.
- Type:
- emoji
The emoji paths.
- Type:
- guild
The guild paths.
- Type:
- interactions
The interactions paths
- Type:
- invite
The invite paths.
- Type:
- stage
The stage paths.
- Type:
- sticker
The sticker paths.
- Type:
- webhook
The webhook paths.
- Type:
- 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’