Exceptions and Warnings¶
This section documents exceptions and warnings thrown by the library and their hierarchy.
Exceptions¶
DiscordException¶
ClientException¶
LoginFailure¶
- exception disnake.LoginFailure[source]¶
Exception that’s raised when the
Client.login()
function fails to log you in from improper credentials or some other misc. failure.
NoMoreItems¶
HTTPException¶
- exception disnake.HTTPException(response, message)[source]¶
Exception that’s raised when an HTTP request operation fails.
- response¶
The response of the failed HTTP request. This is an instance of
aiohttp.ClientResponse
. In some cases this could also be arequests.Response
.- Type:
Forbidden¶
- exception disnake.Forbidden(response, message)[source]¶
Exception that’s raised for when status code 403 occurs.
Subclass of
HTTPException
.
NotFound¶
- exception disnake.NotFound(response, message)[source]¶
Exception that’s raised for when status code 404 occurs.
Subclass of
HTTPException
.
DiscordServerError¶
- exception disnake.DiscordServerError(response, message)[source]¶
Exception that’s raised for when a 500 range status code occurs.
Subclass of
HTTPException
.New in version 1.5.
InvalidData¶
WebhookTokenMissing¶
- exception disnake.WebhookTokenMissing[source]¶
Exception that’s raised when a
Webhook
orSyncWebhook
is missing a token to make requests with.New in version 2.6.
GatewayNotFound¶
ConnectionClosed¶
PrivilegedIntentsRequired¶
- exception disnake.PrivilegedIntentsRequired(shard_id)[source]¶
Exception that’s raised when the gateway is requesting privileged intents but they’re not ticked in the developer page yet.
Go to https://discord.com/developers/applications/ and enable the intents that are required. Currently these are as follows:
SessionStartLimitReached¶
- exception disnake.SessionStartLimitReached(session_start_limit, requested=1)[source]¶
Exception that’s raised when
Client.connect()
function fails to connect to Discord due to the session start limit being reached.New in version 2.6.
- session_start_limit¶
The current state of the session start limit.
- Type:
InteractionException¶
InteractionResponded¶
- exception disnake.InteractionResponded(interaction)[source]¶
Exception that’s raised when sending another interaction response using
InteractionResponse
when one has already been done before.An interaction can only be responded to once.
New in version 2.0.
- interaction¶
The interaction that’s already been responded to.
- Type:
InteractionNotResponded¶
- exception disnake.InteractionNotResponded(interaction)[source]¶
Exception that’s raised when editing an interaction response without sending a response message first.
An interaction must be responded to exactly once.
New in version 2.0.
- interaction¶
The interaction that hasn’t been responded to.
- Type: