Events¶
This section documents events related to the main library.
What are events?¶
So, what are events anyway? Most of the Client application cycle is based on events - special “notifications” usually sent by Discord
to notify client about certain actions like message deletion, emoji creation, member nickname updates, etc.
This library provides a few ways to register an event handler or event listener — a special function which will listen for specific types of events — which allows you to take action based on certain events.
The first way to create an event handler is through the use of the Client.event() decorator.
Note that these are unique, which means you can only have one of
each type (i.e. only one on_message, one on_member_ban, etc.):
client = disnake.Client(...)
@client.event
async def on_message(message):
    if message.author.bot:
        return
    if message.content.startswith('$hello'):
        await message.reply(f'Hello, {message.author}!')
Another way is through subclassing Client and overriding the specific events,
which has essentially the same effect as the Client.event() decorator. For example:
class MyClient(disnake.Client):
    async def on_message(self, message):
        if message.author.bot:
            return
        if message.content.startswith('$hello'):
            await message.reply(f'Hello, {message.author}!')
A separate way is through the use of an event listener. These are similar to the event handlers
described above, but allow you to have as many listeners of the same type as you want.
You can register listeners using the Client.listen() decorator or through the Client.add_listener()
method. Similarly you can remove a listener using the Client.remove_listener() method.
@client.listen()
async def on_message(message: disnake.Message):
    if message.author.bot:
        return
    if message.content.startswith('$hello'):
        await message.reply(f'Hello, {message.author}')
async def my_on_ready():
    print(f'Logged in as {client.user}')
client.add_listener(my_on_ready, 'on_ready')
Lastly, Client.wait_for() is a single-use event handler to wait for
something to happen in more specific scenarios:
@client.event
async def on_message(message):
    if message.content.startswith('$greet'):
        channel = message.channel
        await channel.send('Say hello!')
        def check(m):
            return m.content == 'hello' and m.channel == channel
        # wait for a message that passes the check
        msg = await client.wait_for('message', check=check)
        await channel.send(f'Hello {msg.author}!')
Note
Events can be sent not only by Discord. For instance, if you use the commands extension, you’ll also receive various events related to your commands’ execution process.
If an event handler raises an exception, on_error() will be called
to handle it, which defaults to printing a traceback and ignoring the exception.
Warning
Every event handler/listener must be a coroutine. In order to turn a function into a coroutine, they must be async def functions.
Reference¶
Client¶
This section documents events related to Client and its connectivity to Discord.
- disnake.on_connect()¶
- Called when the client has successfully connected to Discord. This is not the same as the client being fully prepared, see - on_ready()for that.- The warnings on - on_ready()also apply.
- disnake.on_disconnect()¶
- Called when the client has disconnected from Discord, or a connection attempt to Discord has failed. This could happen either through the internet being disconnected, explicit calls to close, or Discord terminating the connection one way or the other. - This function can be called many times without a corresponding - on_connect()call.
- disnake.on_error(event, *args, **kwargs)¶
- Usually when an event raises an uncaught exception, a traceback is printed to stderr and the exception is ignored. If you want to change this behaviour and handle the exception for whatever reason yourself, this event can be overridden. Which, when done, will suppress the default action of printing the traceback. - The information of the exception raised and the exception itself can be retrieved with a standard call to - sys.exc_info().- If you want exception to propagate out of the - Clientclass you can define an- on_errorhandler consisting of a single empty raise statement. Exceptions raised by- on_errorwill not be handled in any way by- Client.- Note - on_errorwill only be dispatched to- Client.event().- It will not be received by - Client.wait_for()and listeners such as- Client.listen(), or- listener().- Parameters:
- event ( - str) – The name of the event that raised the exception.
- args – The positional arguments for the event that raised the exception. 
- kwargs – The keyword arguments for the event that raised the exception. 
 
 
- disnake.on_gateway_error(event, data, shard_id, exc)¶
- When a (known) gateway event cannot be parsed, a traceback is printed to stderr and the exception is ignored by default. This should generally not happen and is usually either a library issue, or caused by a breaking API change. - To change this behaviour, for example to completely stop the bot, this event can be overridden. - This can also be disabled completely by passing - enable_gateway_error_handler=Falseto the client on initialization, restoring the pre-v2.6 behavior.- New in version 2.6. - Note - on_gateway_errorwill only be dispatched to- Client.event().- It will not be received by - Client.wait_for()and listeners such as- Client.listen(), or- listener().- Note - This will not be dispatched for exceptions that occur while parsing - READYand- RESUMEDevent payloads, as exceptions in these events are considered fatal.
- disnake.on_ready()¶
- Called when the client is done preparing the data received from Discord. Usually after login is successful and the - Client.guildsand co. are filled up.- Warning - This function is not guaranteed to be the first event called. Likewise, this function is not guaranteed to only be called once. This library implements reconnection logic and thus will end up calling this event whenever a RESUME request fails. 
- disnake.on_resumed()¶
- Called when the client has resumed a session. 
- disnake.on_shard_connect(shard_id)¶
- Similar to - on_connect()except used by- AutoShardedClientto denote when a particular shard ID has connected to Discord.- New in version 1.4. - Parameters:
- shard_id ( - int) – The shard ID that has connected.
 
- disnake.on_shard_disconnect(shard_id)¶
- Similar to - on_disconnect()except used by- AutoShardedClientto denote when a particular shard ID has disconnected from Discord.- New in version 1.4. - Parameters:
- shard_id ( - int) – The shard ID that has disconnected.
 
- disnake.on_shard_ready(shard_id)¶
- Similar to - on_ready()except used by- AutoShardedClientto denote when a particular shard ID has become ready.- Parameters:
- shard_id ( - int) – The shard ID that is ready.
 
- disnake.on_shard_resumed(shard_id)¶
- Similar to - on_resumed()except used by- AutoShardedClientto denote when a particular shard ID has resumed a session.- New in version 1.4. - Parameters:
- shard_id ( - int) – The shard ID that has resumed.
 
- disnake.on_socket_event_type(event_type)¶
- Called whenever a websocket event is received from the WebSocket. - This is mainly useful for logging how many events you are receiving from the Discord gateway. - New in version 2.0. - Parameters:
- event_type ( - str) – The event type from Discord that is received, e.g.- 'READY'.
 
- disnake.on_socket_raw_receive(msg)¶
- Called whenever a message is completely received from the WebSocket, before it’s processed and parsed. This event is always dispatched when a complete message is received and the passed data is not parsed in any way. - This is only really useful for grabbing the WebSocket stream and debugging purposes. - This requires setting the - enable_debug_eventssetting in the- Client.- Note - This is only for the messages received from the client WebSocket. The voice WebSocket will not trigger this event. - Parameters:
- msg ( - str) – The message passed in from the WebSocket library.
 
- disnake.on_socket_raw_send(payload)¶
- Called whenever a send operation is done on the WebSocket before the message is sent. The passed parameter is the message that is being sent to the WebSocket. - This is only really useful for grabbing the WebSocket stream and debugging purposes. - This requires setting the - enable_debug_eventssetting in the- Client.- Note - This is only for the messages sent from the client WebSocket. The voice WebSocket will not trigger this event. 
Channels/Threads¶
This section documents events related to Discord channels and threads.
- disnake.on_guild_channel_delete(channel)¶
- disnake.on_guild_channel_create(channel)¶
- Called whenever a guild channel is deleted or created. - Note that you can get the guild from - guild.- This requires - Intents.guildsto be enabled.- Parameters:
- channel ( - abc.GuildChannel) – The guild channel that got created or deleted.
 
- disnake.on_guild_channel_update(before, after)¶
- Called whenever a guild channel is updated. e.g. changed name, topic, permissions. - This requires - Intents.guildsto be enabled.- Parameters:
- before ( - abc.GuildChannel) – The updated guild channel’s old info.
- after ( - abc.GuildChannel) – The updated guild channel’s new info.
 
 
- disnake.on_guild_channel_pins_update(channel, last_pin)¶
- Called whenever a message is pinned or unpinned from a guild channel. - This requires - Intents.guildsto be enabled.- Parameters:
- channel ( - abc.GuildChannel|- Thread) – The guild channel that had its pins updated.
- last_pin ( - datetime.datetime|- None) – The latest message that was pinned as an aware datetime in UTC. Could be- None.
 
 
- disnake.on_private_channel_update(before, after)¶
- Called whenever a private group DM is updated. e.g. changed name or topic. - This requires - Intents.messagesto be enabled.- Parameters:
- before ( - GroupChannel) – The updated group channel’s old info.
- after ( - GroupChannel) – The updated group channel’s new info.
 
 
- disnake.on_private_channel_pins_update(channel, last_pin)¶
- Called whenever a message is pinned or unpinned from a private channel. - Parameters:
- channel ( - abc.PrivateChannel) – The private channel that had its pins updated.
- last_pin ( - datetime.datetime|- None) – The latest message that was pinned as an aware datetime in UTC. Could be- None.
 
 
- disnake.on_thread_create(thread)¶
- Called whenever a thread is created. - Note that you can get the guild from - Thread.guild.- This requires - Intents.guildsto be enabled.- Note - This only works for threads created in channels the bot already has access to, and only for public threads unless the bot has the - manage_threadspermission.- New in version 2.5. - Parameters:
- thread ( - Thread) – The thread that got created.
 
- disnake.on_thread_update(before, after)¶
- Called when a thread is updated. If the thread is not found in the internal thread cache, then this event will not be called. Consider using - on_raw_thread_update()which will be called regardless of the cache.- This requires - Intents.guildsto be enabled.- New in version 2.0. 
- disnake.on_thread_delete(thread)¶
- Called when a thread is deleted. If the thread is not found in the internal thread cache, then this event will not be called. Consider using - on_raw_thread_delete()instead.- Note that you can get the guild from - Thread.guild.- This requires - Intents.guildsto be enabled.- New in version 2.0. - Parameters:
- thread ( - Thread) – The thread that got deleted.
 
- disnake.on_thread_join(thread)¶
- Called whenever the bot joins a thread or gets access to a thread (for example, by gaining access to the parent channel). - Note that you can get the guild from - Thread.guild.- This requires - Intents.guildsto be enabled.- Note - This event will not be called for threads created by the bot or threads created on one of the bot’s messages. - New in version 2.0. - Changed in version 2.5: This is no longer being called when a thread is created, see - on_thread_create()instead.- Parameters:
- thread ( - Thread) – The thread that got joined.
 
- disnake.on_thread_remove(thread)¶
- Called whenever a thread is removed. This is different from a thread being deleted. - Note that you can get the guild from - Thread.guild.- This requires - Intents.guildsto be enabled.- Warning - Due to technical limitations, this event might not be called as soon as one expects. Since the library tracks thread membership locally, the API only sends updated thread membership status upon being synced by joining a thread. - New in version 2.0. - Parameters:
- thread ( - Thread) – The thread that got removed.
 
- disnake.on_thread_member_join(member)¶
- disnake.on_thread_member_remove(member)¶
- Called when a - ThreadMemberleaves or joins a- Thread.- You can get the thread a member belongs in by accessing - ThreadMember.thread.- On removal events, if the member being removed is not found in the internal cache, then this event will not be called. Consider using - on_raw_thread_member_remove()instead.- This requires - Intents.membersto be enabled.- New in version 2.0. - Parameters:
- member ( - ThreadMember) – The member who joined or left.
 
- disnake.on_raw_thread_member_remove(payload)¶
- Called when a - ThreadMemberleaves- Thread. Unlike- on_thread_member_remove(), this is called regardless of the thread member cache.- You can get the thread a member belongs in by accessing - ThreadMember.thread.- This requires - Intents.membersto be enabled.- New in version 2.5. - Parameters:
- payload ( - RawThreadMemberRemoveEvent) – The raw event payload data.
 
- disnake.on_raw_thread_update(after)¶
- Called whenever a thread is updated. Unlike - on_thread_update(), this is called regardless of the state of the internal thread cache.- This requires - Intents.guildsto be enabled.- New in version 2.5. - Parameters:
- thread ( - Thread) – The updated thread.
 
- disnake.on_raw_thread_delete(payload)¶
- Called whenever a thread is deleted. Unlike - on_thread_delete(), this is called regardless of the state of the internal thread cache.- Note that you can get the guild from - Thread.guild.- This requires - Intents.guildsto be enabled.- New in version 2.5. - Parameters:
- payload ( - RawThreadDeleteEvent) – The raw event payload data.
 
- disnake.on_webhooks_update(channel)¶
- Called whenever a webhook is created, modified, or removed from a guild channel. - This requires - Intents.webhooksto be enabled.- Parameters:
- channel ( - abc.GuildChannel) – The channel that had its webhooks updated.
 
Guilds¶
This section documents events related to Discord guilds.
General¶
- disnake.on_guild_join(guild)¶
- Called when a - Guildis either created by the- Clientor when the- Clientjoins a guild.- This requires - Intents.guildsto be enabled.- Parameters:
- guild ( - Guild) – The guild that was joined.
 
- disnake.on_guild_remove(guild)¶
- Called when a - Guildis removed from the- Client.- This happens through, but not limited to, these circumstances: - The client got banned. 
- The client got kicked. 
- The client left the guild. 
- The client or the guild owner deleted the guild. 
 - In order for this event to be invoked then the - Clientmust have been part of the guild to begin with. (i.e. it is part of- Client.guilds)- This requires - Intents.guildsto be enabled.- Parameters:
- guild ( - Guild) – The guild that got removed.
 
- disnake.on_guild_update(before, after)¶
- Called when a - Guildupdates, for example:- Changed name 
- Changed AFK channel 
- Changed AFK timeout 
- etc 
 - This requires - Intents.guildsto be enabled.
- disnake.on_guild_available(guild)¶
- Called when a guild becomes available or unavailable. The guild must have existed in the - Client.guildscache.- This requires - Intents.guildsto be enabled.- Parameters:
- guild – The - Guildthat has changed availability.
 
Application Commands¶
- disnake.on_application_command_permissions_update(permissions)¶
- Called when the permissions of an application command or the application-wide command permissions are updated. - Note that this will also be called when permissions of other applications change, not just this application’s permissions. - New in version 2.5. - Parameters:
- permissions ( - GuildApplicationCommandPermissions) – The updated permission object.
 
Audit Logs¶
- disnake.on_audit_log_entry_create(entry)¶
- Called when an audit log entry is created. You must have the - view_audit_logpermission to receive this.- This requires - Intents.moderationto be enabled.- Warning - This scope of data in this gateway event is limited, which means it is much more reliant on the cache than - Guild.audit_logs(). Because of this,- AuditLogEntry.targetand- AuditLogEntry.userwill frequently be of type- Objectinstead of the respective model.- New in version 2.8. - Parameters:
- entry ( - AuditLogEntry) – The audit log entry that was created.
 
AutoMod¶
- disnake.on_automod_action_execution(execution)¶
- Called when an auto moderation action is executed due to a rule triggering for a particular event. You must have the - manage_guildpermission to receive this.- The guild this action has taken place in can be accessed using - AutoModActionExecution.guild.- This requires - Intents.automod_executionto be enabled.- In addition, - Intents.message_contentmust be enabled to receive non-empty values for- AutoModActionExecution.contentand- AutoModActionExecution.matched_content.- Note - This event will fire once per executed - AutoModAction, which means it will run multiple times when a rule is triggered, if that rule has multiple actions defined.- New in version 2.6. - Parameters:
- execution ( - AutoModActionExecution) – The auto moderation action execution data.
 
- disnake.on_automod_rule_create(rule)¶
- Called when an - AutoModRuleis created. You must have the- manage_guildpermission to receive this.- This requires - Intents.automod_configurationto be enabled.- New in version 2.6. - Parameters:
- rule ( - AutoModRule) – The auto moderation rule that was created.
 
- disnake.on_automod_rule_update(rule)¶
- Called when an - AutoModRuleis updated. You must have the- manage_guildpermission to receive this.- This requires - Intents.automod_configurationto be enabled.- New in version 2.6. - Parameters:
- rule ( - AutoModRule) – The auto moderation rule that was updated.
 
- disnake.on_automod_rule_delete(rule)¶
- Called when an - AutoModRuleis deleted. You must have the- manage_guildpermission to receive this.- This requires - Intents.automod_configurationto be enabled.- New in version 2.6. - Parameters:
- rule ( - AutoModRule) – The auto moderation rule that was deleted.
 
Emojis¶
- disnake.on_guild_emojis_update(guild, before, after)¶
- Called when a - Guildadds or removes- Emoji.- This requires - Intents.expressionsto be enabled.
Integrations¶
- disnake.on_guild_integrations_update(guild)¶
- Called whenever an integration is created, modified, or removed from a guild. - This requires - Intents.integrationsto be enabled.- New in version 1.4. - Parameters:
- guild ( - Guild) – The guild that had its integrations updated.
 
- disnake.on_integration_create(integration)¶
- Called when an integration is created. - This requires - Intents.integrationsto be enabled.- New in version 2.0. - Parameters:
- integration ( - Integration) – The integration that was created.
 
- disnake.on_integration_update(integration)¶
- Called when an integration is updated. - This requires - Intents.integrationsto be enabled.- New in version 2.0. - Parameters:
- integration ( - Integration) – The integration that was updated.
 
- disnake.on_raw_integration_delete(payload)¶
- Called when an integration is deleted. - This requires - Intents.integrationsto be enabled.- New in version 2.0. - Parameters:
- payload ( - RawIntegrationDeleteEvent) – The raw event payload data.
 
Invites¶
- disnake.on_invite_create(invite)¶
- Called when an - Inviteis created. You must have the- manage_channelspermission to receive this.- New in version 1.3. - Note - There is a rare possibility that the - Invite.guildand- Invite.channelattributes will be of- Objectrather than the respective models.- This requires - Intents.invitesto be enabled.- Parameters:
- invite ( - Invite) – The invite that was created.
 
- disnake.on_invite_delete(invite)¶
- Called when an - Inviteis deleted. You must have the- manage_channelspermission to receive this.- New in version 1.3. - Note - There is a rare possibility that the - Invite.guildand- Invite.channelattributes will be of- Objectrather than the respective models.- Outside of those two attributes, the only other attribute guaranteed to be filled by the Discord gateway for this event is - Invite.code.- This requires - Intents.invitesto be enabled.- Parameters:
- invite ( - Invite) – The invite that was deleted.
 
Members¶
- disnake.on_member_join(member)¶
- disnake.on_member_remove(member)¶
- Called when a - Memberjoins or leaves a- Guild(this includes getting kicked/banned). If- on_member_remove()is being used then consider using- on_raw_member_remove()which will be called regardless of the cache.- This requires - Intents.membersto be enabled.- Parameters:
- member ( - Member) – The member who joined or left.
 
- disnake.on_member_update(before, after)¶
- Called when a - Memberis updated in a- Guild. This will also be called when a- Userobject linked to a guild- Memberchanges. Consider using- on_raw_member_update()which will be called regardless of the cache.- This is called when one or more of the following things change, but is not limited to: - avatar (guild-specific) 
- current_timeout 
- nickname 
- pending 
- premium_since 
- roles 
 - This requires - Intents.membersto be enabled.
- disnake.on_raw_member_remove(payload)¶
- Called when a member leaves a - Guild(this includes getting kicked/banned). Unlike- on_member_remove(), this is called regardless of the member cache.- New in version 2.6. - Parameters:
- payload ( - RawGuildMemberRemoveEvent) – The raw event payload data.
 
- disnake.on_raw_member_update(member)¶
- Called when a - Memberis updated in a- Guild. This will also be called when a- Userobject linked to a guild- Memberchanges. Unlike- on_member_update(), this is called regardless of the member cache.- New in version 2.6. - Parameters:
- member ( - Member) – The member that was updated.
 
- disnake.on_member_ban(guild, user)¶
- Called when user gets banned from a - Guild.- This requires - Intents.moderationto be enabled.
- disnake.on_member_unban(guild, user)¶
- Called when a - Usergets unbanned from a- Guild.- This requires - Intents.moderationto be enabled.
- disnake.on_presence_update(before, after)¶
- Called when a - Memberupdates their presence.- This is called when one or more of the following things change: - status 
- activity 
 - This requires - Intents.presencesand- Intents.membersto be enabled.- New in version 2.0. 
- disnake.on_raw_presence_update(payload)¶
- Called when a member updates their presence. Unlike - on_presence_update(), this is called regardless of the member cache.- Since the data payload can be partial and the Discord API does not validate the types of the fields, care must be taken when accessing stuff in the dictionary. - This requires - Intents.presencesto be enabled.- New in version 2.10. - Parameters:
- payload ( - RawPresenceUpdateEvent) – The raw event payload data.
 
- disnake.on_user_update(before, after)¶
- Called when a - Useris updated.- This is called when one or more of the following things change, but is not limited to: - avatar 
- discriminator 
- name 
- global_name 
- public_flags 
 - This requires - Intents.membersto be enabled.
Roles¶
- disnake.on_guild_role_create(role)¶
- disnake.on_guild_role_delete(role)¶
- Called when a - Guildcreates or deletes a- Role.- To get the guild it belongs to, use - Role.guild.- This requires - Intents.guildsto be enabled.- Parameters:
- role ( - Role) – The role that was created or deleted.
 
- disnake.on_guild_role_update(before, after)¶
- Called when a - Roleis changed guild-wide.- This requires - Intents.guildsto be enabled.
Scheduled Events¶
- disnake.on_guild_scheduled_event_create(event)¶
- disnake.on_guild_scheduled_event_delete(event)¶
- Called when a guild scheduled event is created or deleted. - This requires - Intents.guild_scheduled_eventsto be enabled.- New in version 2.3. - Parameters:
- event ( - GuildScheduledEvent) – The guild scheduled event that was created or deleted.
 
- disnake.on_guild_scheduled_event_update(before, after)¶
- Called when a guild scheduled event is updated. The guild must have existed in the - Client.guildscache.- This requires - Intents.guild_scheduled_eventsto be enabled.- New in version 2.3. - Parameters:
- before ( - GuildScheduledEvent) – The guild scheduled event before the update.
- after ( - GuildScheduledEvent) – The guild scheduled event after the update.
 
 
- disnake.on_guild_scheduled_event_subscribe(event, user)¶
- disnake.on_guild_scheduled_event_unsubscribe(event, user)¶
- Called when a user subscribes to or unsubscribes from a guild scheduled event. - This requires - Intents.guild_scheduled_eventsand- Intents.membersto be enabled.- New in version 2.3. - Parameters:
- event ( - GuildScheduledEvent) – The guild scheduled event that the user subscribed to or unsubscribed from.
- user ( - Member|- User) – The user who subscribed to or unsubscribed from the event.
 
 
- disnake.on_raw_guild_scheduled_event_subscribe(payload)¶
- disnake.on_raw_guild_scheduled_event_unsubscribe(payload)¶
- Called when a user subscribes to or unsubscribes from a guild scheduled event. Unlike - on_guild_scheduled_event_subscribe()and- on_guild_scheduled_event_unsubscribe(), this is called regardless of the guild scheduled event cache.- Parameters:
- payload ( - RawGuildScheduledEventUserActionEvent) – The raw event payload data.
 
Soundboard¶
- disnake.on_guild_soundboard_sounds_update(guild, before, after)¶
- Called when a - Guildupdates its soundboard sounds.- This requires - Intents.expressionsto be enabled.- New in version 2.10. - Parameters:
- guild ( - Guild) – The guild who got their soundboard sounds updated.
- before ( - Sequence[- GuildSoundboardSound]) – A list of soundboard sounds before the update.
- after ( - Sequence[- GuildSoundboardSound]) – A list of soundboard sounds after the update.
 
 
Stage Instances¶
- disnake.on_stage_instance_create(stage_instance)¶
- disnake.on_stage_instance_delete(stage_instance)¶
- Called when a - StageInstanceis created or deleted for a- StageChannel.- New in version 2.0. - Parameters:
- stage_instance ( - StageInstance) – The stage instance that was created or deleted.
 
- disnake.on_stage_instance_update(before, after)¶
- Called when a - StageInstanceis updated.- The following, but not limited to, examples illustrate when this event is called: - The topic is changed. 
- The privacy level is changed. 
 - New in version 2.0. - Parameters:
- before ( - StageInstance) – The stage instance before the update.
- after ( - StageInstance) – The stage instance after the update.
 
 
Stickers¶
- disnake.on_guild_stickers_update(guild, before, after)¶
- Called when a - Guildupdates its stickers.- This requires - Intents.expressionsto be enabled.- New in version 2.0. - Parameters:
- guild ( - Guild) – The guild who got their stickers updated.
- before ( - Sequence[- GuildSticker]) – A list of stickers before the update.
- after ( - Sequence[- GuildSticker]) – A list of stickers after the update.
 
 
Voice¶
- disnake.on_voice_state_update(member, before, after)¶
- Called when a - Memberchanges their- VoiceState.- The following, but not limited to, examples illustrate when this event is called: - A member joins a voice or stage channel. 
- A member leaves a voice or stage channel. 
- A member is muted or deafened by their own accord. 
- A member is muted or deafened by a guild administrator. 
 - This requires - Intents.voice_statesto be enabled.- Parameters:
- member ( - Member) – The member whose voice states changed.
- before ( - VoiceState) – The voice state prior to the changes.
- after ( - VoiceState) – The voice state after the changes.
 
 
- disnake.on_voice_channel_effect(channel, member, effect)¶
- Called when a - Membersends an effect in a voice channel the bot is connected to.- This requires - Intents.voice_statesand- Intents.membersto be enabled.- If the member is not found in the internal member cache, then this event will not be called. Consider using - on_raw_voice_channel_effect()instead.- New in version 2.10. - Parameters:
- channel ( - VoiceChannel) – The voice channel where the effect was sent.
- member ( - Member) – The member that sent the effect.
- effect ( - VoiceChannelEffect) – The effect that was sent.
 
 
- disnake.on_raw_voice_channel_effect(payload)¶
- Called when a - Membersends an effect in a voice channel the bot is connected to. Unlike- on_voice_channel_effect(), this is called regardless of the member cache.- This requires - Intents.voice_statesto be enabled.- New in version 2.10. - Parameters:
- payload ( - RawVoiceChannelEffectEvent) – The raw event payload data.
 
Interactions¶
This section documents events related to application commands and other interactions.
- disnake.on_application_command(interaction)¶
- Called when an application command is invoked. - Warning - This is a low level function that is not generally meant to be used. Consider using - Botor- InteractionBotinstead.- Warning - If you decide to override this event and are using - Botor related types, make sure to call- Bot.process_application_commandsto ensure that the application commands are processed.- New in version 2.0. - Parameters:
- interaction ( - ApplicationCommandInteraction) – The interaction object.
 
- disnake.on_application_command_autocomplete(interaction)¶
- Called when an application command autocomplete is called. - Warning - This is a low level function that is not generally meant to be used. Consider using - Botor- InteractionBotinstead.- Warning - If you decide to override this event and are using - Botor related types, make sure to call- Bot.process_app_command_autocompletionto ensure that the application command autocompletion is processed.- New in version 2.0. - Parameters:
- interaction ( - ApplicationCommandInteraction) – The interaction object.
 
- disnake.on_button_click(interaction)¶
- Called when a button is clicked. - New in version 2.0. - Parameters:
- interaction ( - MessageInteraction) – The interaction object.
 
- disnake.on_dropdown(interaction)¶
- Called when a select menu is clicked. - New in version 2.0. - Parameters:
- interaction ( - MessageInteraction) – The interaction object.
 
- disnake.on_interaction(interaction)¶
- Called when an interaction happened. - This currently happens due to application command invocations or components being used. - Warning - This is a low level function that is not generally meant to be used. - New in version 2.0. - Parameters:
- interaction ( - Interaction) – The interaction object.
 
- disnake.on_message_interaction(interaction)¶
- Called when a message interaction happened. - This currently happens due to components being used. - New in version 2.0. - Parameters:
- interaction ( - MessageInteraction) – The interaction object.
 
- disnake.on_modal_submit(interaction)¶
- Called when a modal is submitted. - New in version 2.4. - Parameters:
- interaction ( - ModalInteraction) – The interaction object.
 
Messages¶
This section documents events related to Discord chat messages.
- disnake.on_message(message)¶
- Called when a - Messageis created and sent.- This requires - Intents.messagesto be enabled.- Warning - Your bot’s own messages and private messages are sent through this event. This can lead cases of ‘recursion’ depending on how your bot was programmed. If you want the bot to not reply to itself, consider checking the user IDs. Note that - Botdoes not have this problem.- Note - Not all messages will have - content. This is a Discord limitation. See the docs of- Intents.message_contentfor more information.- Parameters:
- message ( - Message) – The current message.
 
- disnake.on_message_edit(before, after)¶
- Called when a - Messagereceives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.- If this occurs increase the - max_messagesparameter or use the- on_raw_message_edit()event instead.- Note - Not all messages will have - content. This is a Discord limitation. See the docs of- Intents.message_contentfor more information.- The following non-exhaustive cases trigger this event: - A message has been pinned or unpinned. 
- The message content has been changed. 
- The message has received an embed. - For performance reasons, the embed server does not do this in a “consistent” manner. 
 
- The message’s embeds were suppressed or unsuppressed. 
- A call message has received an update to its participants or ending time. 
 - This requires - Intents.messagesto be enabled.
- disnake.on_message_delete(message)¶
- Called when a message is deleted. If the message is not found in the internal message cache, then this event will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds. - If this occurs increase the - max_messagesparameter or use the- on_raw_message_delete()event instead.- This requires - Intents.messagesto be enabled.- Note - Not all messages will have - content. This is a Discord limitation. See the docs of- Intents.message_contentfor more information.- Parameters:
- message ( - Message) – The deleted message.
 
- disnake.on_bulk_message_delete(messages)¶
- Called when messages are bulk deleted. If none of the messages deleted are found in the internal message cache, then this event will not be called. If individual messages were not found in the internal message cache, this event will still be called, but the messages not found will not be included in the messages list. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds. - If this occurs increase the - max_messagesparameter or use the- on_raw_bulk_message_delete()event instead.- This requires - Intents.messagesto be enabled.
- disnake.on_poll_vote_add(member, answer)¶
- Called when a vote is added on a poll. If the member or message is not found in the internal cache, then this event will not be called. - This requires - Intents.guild_pollsor- Intents.dm_pollsto be enabled to receive events about polls sent in guilds or DMs.- Note - You can use - Intents.pollsto enable both- Intents.guild_pollsand- Intents.dm_pollsin one go.- Parameters:
- member ( - Member) – The member who voted.
- answer ( - PollAnswer) – The- PollAnswerobject for which the vote was added.
 
 
- disnake.on_poll_vote_remove(member, answer)¶
- Called when a vote is removed on a poll. If the member or message is not found in the internal cache, then this event will not be called. - This requires - Intents.guild_pollsor- Intents.dm_pollsto be enabled to receive events about polls sent in guilds or DMs.- Note - You can use - Intents.pollsto enable both- Intents.guild_pollsand- Intents.dm_pollsin one go.- Parameters:
- member ( - Member) – The member who removed the vote.
- answer ( - PollAnswer) – The- PollAnswerobject for which the vote was removed.
 
 
- disnake.on_raw_message_edit(payload)¶
- Called when a message is edited. Unlike - on_message_edit(), this is called regardless of the state of the internal message cache.- If the message is found in the message cache, it can be accessed via - RawMessageUpdateEvent.cached_message. The cached message represents the message before it has been edited. For example, if the content of a message is modified and triggers the- on_raw_message_edit()coroutine, the- RawMessageUpdateEvent.cached_messagewill return a- Messageobject that represents the message before the content was modified.- Due to the inherently raw nature of this event, the data parameter coincides with the raw data given by the gateway. - Since the data payload can be partial, care must be taken when accessing stuff in the dictionary. One example of a common case of partial data is when the - 'content'key is inaccessible. This denotes an “embed” only edit, which is an edit in which only the embeds are updated by the Discord embed server.- This requires - Intents.messagesto be enabled.- Parameters:
- payload ( - RawMessageUpdateEvent) – The raw event payload data.
 
- disnake.on_raw_message_delete(payload)¶
- Called when a message is deleted. Unlike - on_message_delete(), this is called regardless of the message being in the internal message cache or not.- If the message is found in the message cache, it can be accessed via - RawMessageDeleteEvent.cached_message- This requires - Intents.messagesto be enabled.- Parameters:
- payload ( - RawMessageDeleteEvent) – The raw event payload data.
 
- disnake.on_raw_bulk_message_delete(payload)¶
- Called when a bulk delete is triggered. Unlike - on_bulk_message_delete(), this is called regardless of the messages being in the internal message cache or not.- If the messages are found in the message cache, they can be accessed via - RawBulkMessageDeleteEvent.cached_messages- This requires - Intents.messagesto be enabled.- Parameters:
- payload ( - RawBulkMessageDeleteEvent) – The raw event payload data.
 
- disnake.on_raw_poll_vote_add(payload)¶
- Called when a vote is added on a poll. Unlike - on_poll_vote_add(), this is called regardless of the guilds being in the internal guild cache or not.- This requires - Intents.guild_pollsor- Intents.dm_pollsto be enabled to receive events about polls sent in guilds or DMs.- Note - You can use - Intents.pollsto enable both- Intents.guild_pollsand- Intents.dm_pollsin one go.- Parameters:
- payload ( - RawPollVoteActionEvent) – The raw event payload data.
 
- disnake.on_raw_poll_vote_remove(payload)¶
- Called when a vote is removed on a poll. Unlike - on_poll_vote_remove(), this is called regardless of the guilds being in the internal guild cache or not.- This requires - Intents.guild_pollsor- Intents.dm_pollsto be enabled to receive events about polls sent in guilds or DMs.- Note - You can use - Intents.pollsto enable both- Intents.guild_pollsand- Intents.dm_pollsin one go.- Parameters:
- payload ( - RawPollVoteActionEvent) – The raw event payload data.
 
- disnake.on_reaction_add(reaction, user)¶
- Called when a message has a reaction added to it. Similar to - on_message_edit(), if the message is not found in the internal message cache, then this event will not be called. Consider using- on_raw_reaction_add()instead.- Note - To get the - Messagebeing reacted, access it via- Reaction.message.- This requires - Intents.reactionsto be enabled.- Note - This doesn’t require - Intents.memberswithin a guild context, but due to Discord not providing updated user information in a direct message it’s required for direct messages to receive this event. Consider using- on_raw_reaction_add()if you need this and do not otherwise want to enable the members intent.
- disnake.on_reaction_remove(reaction, user)¶
- Called when a message has a reaction removed from it. Similar to on_message_edit, if the message is not found in the internal message cache, then this event will not be called. - Note - To get the message being reacted, access it via - Reaction.message.- This requires both - Intents.reactionsand- Intents.membersto be enabled.- Note - Consider using - on_raw_reaction_remove()if you need this and do not want to enable the members intent.
- disnake.on_reaction_clear(message, reactions)¶
- Called when a message has all its reactions removed from it. Similar to - on_message_edit(), if the message is not found in the internal message cache, then this event will not be called. Consider using- on_raw_reaction_clear()instead.- This requires - Intents.reactionsto be enabled.
- disnake.on_reaction_clear_emoji(reaction)¶
- Called when a message has a specific reaction removed from it. Similar to - on_message_edit(), if the message is not found in the internal message cache, then this event will not be called. Consider using- on_raw_reaction_clear_emoji()instead.- This requires - Intents.reactionsto be enabled.- New in version 1.3. - Parameters:
- reaction ( - Reaction) – The reaction that got cleared.
 
- disnake.on_raw_reaction_add(payload)¶
- Called when a message has a reaction added. Unlike - on_reaction_add(), this is called regardless of the state of the internal message cache.- This requires - Intents.reactionsto be enabled.- Parameters:
- payload ( - RawReactionActionEvent) – The raw event payload data.
 
- disnake.on_raw_reaction_remove(payload)¶
- Called when a message has a reaction removed. Unlike - on_reaction_remove(), this is called regardless of the state of the internal message cache.- This requires - Intents.reactionsto be enabled.- Parameters:
- payload ( - RawReactionActionEvent) – The raw event payload data.
 
- disnake.on_raw_reaction_clear(payload)¶
- Called when a message has all its reactions removed. Unlike - on_reaction_clear(), this is called regardless of the state of the internal message cache.- This requires - Intents.reactionsto be enabled.- Parameters:
- payload ( - RawReactionClearEvent) – The raw event payload data.
 
- disnake.on_raw_reaction_clear_emoji(payload)¶
- Called when a message has a specific reaction removed from it. Unlike - on_reaction_clear_emoji()this is called regardless of the state of the internal message cache.- This requires - Intents.reactionsto be enabled.- New in version 1.3. - Parameters:
- payload ( - RawReactionClearEmojiEvent) – The raw event payload data.
 
- disnake.on_typing(channel, user, when)¶
- Called when someone begins typing a message. - The - channelparameter can be a- abc.Messageableinstance, or a- ForumChannelor- MediaChannel. If channel is an- abc.Messageableinstance, it could be a- TextChannel,- VoiceChannel,- StageChannel,- GroupChannel, or- DMChannel.- If the - channelis not a- DMChannel, then the- userparameter is a- Member, otherwise it is a- User.- If the - channelis a- DMChanneland the user is not found in the internal user/member cache, then this event will not be called. Consider using- on_raw_typing()instead.- This requires - Intents.typingand- Intents.guildsto be enabled.- Note - This doesn’t require - Intents.memberswithin a guild context, but due to Discord not providing updated user information in a direct message it’s required for direct messages to receive this event, if the bot didn’t explicitly open the DM channel in the same session (through- User.create_dm(),- Client.create_dm(), or indirectly by sending a message to the user). Consider using- on_raw_typing()if you need this and do not otherwise want to enable the members intent.- Parameters:
- channel ( - abc.Messageable|- ForumChannel|- MediaChannel) – The location where the typing originated from.
- when ( - datetime.datetime) – When the typing started as an aware datetime in UTC.
 
 
- disnake.on_raw_typing(data)¶
- Called when someone begins typing a message. - This is similar to - on_typing()except that it is called regardless of whether- Intents.membersand- Intents.guildsare enabled.- Parameters:
- data ( - RawTypingEvent) – The raw event payload data.
 
Monetization¶
This section documents events related to monetization, including application subscriptions and entitlements.
- disnake.on_entitlement_create(entitlement)¶
- Called when an entitlement is created. - This is usually caused by a user subscribing to an SKU, or when a new test entitlement is created (see - Client.create_entitlement()).- New in version 2.10. - Parameters:
- entitlement ( - Entitlement) – The entitlement that was created.
 
- disnake.on_entitlement_update(entitlement)¶
- Called when an entitlement is updated. - This happens only when a user’s subscription ends or is cancelled (in which case the - Entitlement.ends_atattribute reflects the expiration date).- New in version 2.10. - Parameters:
- entitlement ( - Entitlement) – The entitlement that was updated.
 
- disnake.on_entitlement_delete(entitlement)¶
- Called when an entitlement is deleted. - Note - This does not get called when an entitlement expires; it only occurs e.g. in case of refunds or due to manual removal. - New in version 2.10. - Parameters:
- entitlement ( - Entitlement) – The entitlement that was deleted.
 
- disnake.on_subscription_create(subscription)¶
- Called when a subscription is created. - New in version 2.10. - Parameters:
- subscription ( - Subscription) – The subscription that was created.
 
- disnake.on_subscription_update(subscription)¶
- Called when a subscription is updated. - New in version 2.10. - Parameters:
- subscription ( - Subscription) – The subscription that was updated.
 
- disnake.on_subscription_delete(subscription)¶
- Called when a subscription is deleted. - New in version 2.10. - Parameters:
- subscription ( - Subscription) – The subscription that was deleted.
 
Enumerations¶
Event¶
- class disnake.Event[source]¶
- Represents all the events of the library. - These offer to register listeners/events in a more pythonic way; additionally autocompletion and documentation are both supported. - New in version 2.8. - connect¶
- Called when the client has successfully connected to Discord. Represents the - on_connect()event.
 - disconnect¶
- Called when the client has disconnected from Discord, or a connection attempt to Discord has failed. Represents the - on_disconnect()event.
 - error¶
- Called when an uncaught exception occurred. Represents the - on_error()event.
 - gateway_error¶
- Called when a known gateway event cannot be parsed. Represents the - on_gateway_error()event.
 - ready¶
- Called when the client is done preparing the data received from Discord. Represents the - on_ready()event.
 - resumed¶
- Called when the client has resumed a session. Represents the - on_resumed()event.
 - shard_connect¶
- Called when a shard has successfully connected to Discord. Represents the - on_shard_connect()event.
 - shard_disconnect¶
- Called when a shard has disconnected from Discord. Represents the - on_shard_disconnect()event.
 - shard_ready¶
- Called when a shard has become ready. Represents the - on_shard_ready()event.
 - shard_resumed¶
- Called when a shard has resumed a session. Represents the - on_shard_resumed()event.
 - socket_event_type¶
- Called whenever a websocket event is received from the WebSocket. Represents the - on_socket_event_type()event.
 - socket_raw_receive¶
- Called whenever a message is completely received from the WebSocket, before it’s processed and parsed. Represents the - on_socket_raw_receive()event.
 - socket_raw_send¶
- Called whenever a send operation is done on the WebSocket before the message is sent. Represents the - on_socket_raw_send()event.
 - guild_channel_create¶
- Called whenever a guild channel is created. Represents the - on_guild_channel_create()event.
 - guild_channel_update¶
- Called whenever a guild channel is updated. Represents the - on_guild_channel_update()event.
 - guild_channel_delete¶
- Called whenever a guild channel is deleted. Represents the - on_guild_channel_delete()event.
 - guild_channel_pins_update¶
- Called whenever a message is pinned or unpinned from a guild channel. Represents the - on_guild_channel_pins_update()event.
 - invite_create¶
- Called when an - Inviteis created. Represents the- on_invite_create()event.
 - invite_delete¶
- Called when an Invite is deleted. Represents the - on_invite_delete()event.
 - private_channel_update¶
- Called whenever a private group DM is updated. Represents the - on_private_channel_update()event.
 - private_channel_pins_update¶
- Called whenever a message is pinned or unpinned from a private channel. Represents the - on_private_channel_pins_update()event.
 - webhooks_update¶
- Called whenever a webhook is created, modified, or removed from a guild channel. Represents the - on_webhooks_update()event.
 - thread_create¶
- Called whenever a thread is created. Represents the - on_thread_create()event.
 - thread_update¶
- Called when a thread is updated. Represents the - on_thread_update()event.
 - thread_delete¶
- Called when a thread is deleted. Represents the - on_thread_delete()event.
 - thread_join¶
- Called whenever the bot joins a thread or gets access to a thread. Represents the - on_thread_join()event.
 - thread_remove¶
- Called whenever a thread is removed. This is different from a thread being deleted. Represents the - on_thread_remove()event.
 - thread_member_join¶
- Called when a ThreadMember joins a Thread. Represents the - on_thread_member_join()event.
 - thread_member_remove¶
- Called when a ThreadMember leaves a Thread. Represents the - on_thread_member_remove()event.
 - raw_thread_member_remove¶
- Called when a ThreadMember leaves Thread regardless of the thread member cache. Represents the - on_raw_thread_member_remove()event.
 - raw_thread_update¶
- Called whenever a thread is updated regardless of the state of the internal thread cache. Represents the - on_raw_thread_update()event.
 - raw_thread_delete¶
- Called whenever a thread is deleted regardless of the state of the internal thread cache. Represents the - on_raw_thread_delete()event.
 - guild_join¶
- Called when a Guild is either created by the Client or when the Client joins a guild. Represents the - on_guild_join()event.
 - guild_remove¶
- Called when a Guild is removed from the - Client. Represents the- on_guild_remove()event.
 - guild_update¶
- Called when a Guild updates. Represents the - on_guild_update()event.
 - guild_available¶
- Called when a guild becomes available. Represents the - on_guild_available()event.
 - Called when a guild becomes unavailable. Represents the - on_guild_unavailable()event.
 - guild_role_create¶
- Called when a Guild creates a new Role. Represents the - on_guild_role_create()event.
 - guild_role_delete¶
- Called when a Guild deletes a Role. Represents the - on_guild_role_delete()event.
 - guild_role_update¶
- Called when a Guild updates a Role. Represents the - on_guild_role_update()event.
 - guild_emojis_update¶
- Called when a Guild adds or removes Emoji. Represents the - on_guild_emojis_update()event.
 - guild_stickers_update¶
- Called when a Guild updates its stickers. Represents the - on_guild_stickers_update()event.
 - guild_soundboard_sounds_update¶
- Called when a Guild updates its soundboard sounds. Represents the - on_guild_soundboard_sounds_update()event.- New in version 2.10. 
 - guild_integrations_update¶
- Called whenever an integration is created, modified, or removed from a guild. Represents the - on_guild_integrations_update()event.
 - guild_scheduled_event_create¶
- Called when a guild scheduled event is created. Represents the - on_guild_scheduled_event_create()event.
 - guild_scheduled_event_update¶
- Called when a guild scheduled event is updated. Represents the - on_guild_scheduled_event_update()event.
 - guild_scheduled_event_delete¶
- Called when a guild scheduled event is deleted. Represents the - on_guild_scheduled_event_delete()event.
 - guild_scheduled_event_subscribe¶
- Called when a user subscribes from a guild scheduled event. Represents the - on_guild_scheduled_event_subscribe()event.
 - guild_scheduled_event_unsubscribe¶
- Called when a user unsubscribes from a guild scheduled event. Represents the - on_guild_scheduled_event_unsubscribe()event.
 - raw_guild_scheduled_event_subscribe¶
- Called when a user subscribes from a guild scheduled event regardless of the guild scheduled event cache. Represents the - on_raw_guild_scheduled_event_subscribe()event.
 - raw_guild_scheduled_event_unsubscribe¶
- Called when a user subscribes to or unsubscribes from a guild scheduled event regardless of the guild scheduled event cache. Represents the - on_raw_guild_scheduled_event_unsubscribe()event.
 - application_command_permissions_update¶
- Called when the permissions of an application command or the application-wide command permissions are updated. Represents the - on_application_command_permissions_update()event.
 - automod_action_execution¶
- Called when an auto moderation action is executed due to a rule triggering for a particular event. Represents the - on_automod_action_execution()event.
 - automod_rule_create¶
- Called when an AutoModRule is created. Represents the - on_automod_rule_create()event.
 - automod_rule_update¶
- Called when an AutoModRule is updated. Represents the - on_automod_rule_update()event.
 - automod_rule_delete¶
- Called when an AutoModRule is deleted. Represents the - on_automod_rule_delete()event.
 - audit_log_entry_create¶
- Called when an audit log entry is created. Represents the - on_audit_log_entry_create()event.
 - integration_create¶
- Called when an integration is created. Represents the - on_integration_create()event.
 - integration_update¶
- Called when an integration is updated. Represents the - on_integration_update()event.
 - raw_integration_delete¶
- Called when an integration is deleted. Represents the - on_raw_integration_delete()event.
 - member_join¶
- Called when a Member joins a Guild. Represents the - on_member_join()event.
 - member_remove¶
- Called when a Member leaves a Guild. Represents the - on_member_remove()event.
 - member_update¶
- Called when a Member is updated in a Guild. Represents the - on_member_update()event.
 - raw_member_remove¶
- Called when a member leaves a Guild regardless of the member cache. Represents the - on_raw_member_remove()event.
 - raw_member_update¶
- Called when a Member is updated in a Guild regardless of the member cache. Represents the - on_raw_member_update()event.
 - member_ban¶
- Called when user gets banned from a Guild. Represents the - on_member_ban()event.
 - member_unban¶
- Called when a User gets unbanned from a Guild. Represents the - on_member_unban()event.
 - presence_update¶
- Called when a Member updates their presence. Represents the - on_presence_update()event.
 - user_update¶
- Called when a User is updated. Represents the - on_user_update()event.
 - voice_state_update¶
- Called when a Member changes their VoiceState. Represents the - on_voice_state_update()event.
 - voice_channel_effect¶
- Called when a Member sends an effect in a voice channel the bot is connected to. Represents the - on_voice_channel_effect()event.- New in version 2.10. 
 - raw_voice_channel_effect¶
- Called when a Member sends an effect in a voice channel the bot is connected to, regardless of the member cache. Represents the - on_raw_voice_channel_effect()event.- New in version 2.10. 
 - stage_instance_create¶
- Called when a StageInstance is created for a StageChannel. Represents the - on_stage_instance_create()event.
 - stage_instance_delete¶
- Called when a StageInstance is deleted for a StageChannel. Represents the - on_stage_instance_delete()event.
 - stage_instance_update¶
- Called when a StageInstance is updated. Represents the - on_stage_instance_update()event.
 - application_command¶
- Called when an application command is invoked. Represents the - on_application_command()event.
 - application_command_autocomplete¶
- Called when an application command autocomplete is called. Represents the - on_application_command_autocomplete()event.
 - button_click¶
- Called when a button is clicked. Represents the - on_button_click()event.
 - dropdown¶
- Called when a select menu is clicked. Represents the - on_dropdown()event.
 - interaction¶
- Called when an interaction happened. Represents the - on_interaction()event.
 - message_interaction¶
- Called when a message interaction happened. Represents the - on_message_interaction()event.
 - modal_submit¶
- Called when a modal is submitted. Represents the - on_modal_submit()event.
 - message¶
- Called when a Message is created and sent. Represents the - on_message()event.
 - message_edit¶
- Called when a Message receives an update event. Represents the - on_message_edit()event.
 - message_delete¶
- Called when a message is deleted. Represents the - on_message_delete()event.
 - bulk_message_delete¶
- Called when messages are bulk deleted. Represents the - on_bulk_message_delete()event.
 - poll_vote_add¶
- Called when a vote is added on a Poll. Represents the - on_poll_vote_add()event.
 - poll_vote_remove¶
- Called when a vote is removed from a Poll. Represents the - on_poll_vote_remove()event.
 - raw_message_edit¶
- Called when a message is edited regardless of the state of the internal message cache. Represents the - on_raw_message_edit()event.
 - raw_message_delete¶
- Called when a message is deleted regardless of the message being in the internal message cache or not. Represents the - on_raw_message_delete()event.
 - raw_bulk_message_delete¶
- Called when a bulk delete is triggered regardless of the messages being in the internal message cache or not. Represents the - on_raw_bulk_message_delete()event.
 - raw_poll_vote_add¶
- Called when a vote is added on a Poll regardless of the internal message cache. Represents the - on_raw_poll_vote_add()event.
 - raw_poll_vote_remove¶
- Called when a vote is removed from a Poll regardless of the internal message cache. Represents the - on_raw_poll_vote_remove()event.
 - reaction_add¶
- Called when a message has a reaction added to it. Represents the - on_reaction_add()event.
 - reaction_remove¶
- Called when a message has a reaction removed from it. Represents the - on_reaction_remove()event.
 - reaction_clear¶
- Called when a message has all its reactions removed from it. Represents the - on_reaction_clear()event.
 - reaction_clear_emoji¶
- Called when a message has a specific reaction removed from it. Represents the - on_reaction_clear_emoji()event.
 - raw_presence_update¶
- Called when a user’s presence changes regardless of the state of the internal member cache. Represents the - on_raw_presence_update()event.
 - raw_reaction_add¶
- Called when a message has a reaction added regardless of the state of the internal message cache. Represents the - on_raw_reaction_add()event.
 - raw_reaction_remove¶
- Called when a message has a reaction removed regardless of the state of the internal message cache. Represents the - on_raw_reaction_remove()event.
 - raw_reaction_clear¶
- Called when a message has all its reactions removed regardless of the state of the internal message cache. Represents the - on_raw_reaction_clear()event.
 - raw_reaction_clear_emoji¶
- Called when a message has a specific reaction removed from it regardless of the state of the internal message cache. Represents the - on_raw_reaction_clear_emoji()event.
 - typing¶
- Called when someone begins typing a message. Represents the - on_typing()event.
 - raw_typing¶
- Called when someone begins typing a message regardless of whether Intents.members and Intents.guilds are enabled. Represents the - on_raw_typing()event.
 - entitlement_create¶
- Called when a user subscribes to an SKU, creating a new - Entitlement. Represents the- on_entitlement_create()event.- New in version 2.10. 
 - entitlement_update¶
- Called when a user’s subscription renews. Represents the - on_entitlement_update()event.- New in version 2.10. 
 - entitlement_delete¶
- Called when a user’s entitlement is deleted. Represents the - on_entitlement_delete()event.
 - subscription_create¶
- Called when a subscription for a premium app is created. Represents the - on_subscription_create()event.- New in version 2.10. 
 - subscription_update¶
- Called when a subscription for a premium app is updated. Represents the - on_subscription_update()event.- New in version 2.10. 
 - subscription_delete¶
- Called when a subscription for a premium app is deleted. Represents the - on_subscription_delete()event.- New in version 2.10. 
 - command¶
- Called when a command is found and is about to be invoked. Represents the - on_command()event.
 - command_completion¶
- Called when a command has completed its invocation. Represents the - on_command_completion()event.
 - command_error¶
- Called when an error is raised inside a command either through user input error, check failure, or an error in your own code. Represents the - on_command_error()event.
 - slash_command¶
- Called when a slash command is found and is about to be invoked. Represents the - on_slash_command()event.
 - slash_command_completion¶
- Called when a slash command has completed its invocation. Represents the - on_slash_command_completion()event.
 - slash_command_error¶
- Called when an error is raised inside a slash command either through user input error, check failure, or an error in your own code. Represents the - on_slash_command_error()event.
 - user_command¶
- Called when a user command is found and is about to be invoked. Represents the - on_user_command()event.
 - user_command_completion¶
- Called when a user command has completed its invocation. Represents the - on_user_command_completion()event.
 - user_command_error¶
- Called when an error is raised inside a user command either through check failure, or an error in your own code. Represents the - on_user_command_error()event.
 - message_command¶
- Called when a message command is found and is about to be invoked. Represents the - on_message_command()event.
 - message_command_completion¶
- Called when a message command has completed its invocation. Represents the - on_message_command_completion()event.
 - message_command_error¶
- Called when an error is raised inside a message command either through check failure, or an error in your own code. Represents the - on_message_command_error()event.