Pincer Middleware Module#

Activity Join#

activity_join_middleware#

await activity_join_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_activity_join event.

Parameters
  • payload (GatewayDispatch) – The data received from the activity join event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_activity_join and an ActivityJoinEvent

Return type

Tuple[str, ActivityJoinEvent]

Activity Join Request#

activity_join_request_middleware#

await activity_join_request_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_activity_join_request event.

Parameters
  • payload (GatewayDispatch) – The data received from the activity join request event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_activity_join_request and a User

Return type

Tuple[str, User]

Activity Spectate#

activity_spectate_middleware#

await activity_spectate_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_activity_spectate event.

Parameters
  • payload (GatewayDispatch) – The data received from the activity spectate event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_activity_spectate and an ActivitySpectateEvent

Return type

Tuple[str, ActivitySpectateEvent]

Channel Create#

channel_create_middleware#

await channel_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_channel_creation event.

Parameters
  • payload (GatewayDispatch) – The data received from the ready event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_channel_creation and a channel.

Return type

Tuple[str, List[Channel]]

Channel Delete#

channel_delete_middleware#

await channel_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_channel_delete event.

Parameters
  • payload (pincer.core.gateway.GatewayDispatch) – The data received from the channel delete event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_channel_delete and a Channel

Return type

Tuple[str, Channel]

Channel Pins Update#

channel_pins_update_middleware#

await channel_pins_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_channel_pins_update event.

Parameters
  • payload (pincer.core.gateway.GatewayDispatch) – The data received from the channel pins update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_channel_pins_update and a Channel

Return type

Tuple[str, Channel]

Channel Update#

channel_update_middleware#

await channel_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_channel_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the channel update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_channel_update and a Channel

Return type

Tuple[str, Channel]

Error#

error_middleware#

error_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_error event.

Parameters
  • payload (GatewayDispatch) – The data received from the ready event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_error and a DiscordError

Return type

Tuple[str, DiscordError]

Guild Ban Add#

guild_ban_add_middleware#

await guild_ban_add_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_ban_add event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild ban add event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_ban_add_update and a GuildBanAddEvent

Return type

Tuple[str, GuildBaAddEvent]

Guild Ban Remove#

guild_ban_remove_middleware#

await guild_ban_remove_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_ban_remove event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild ban remove event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_ban_remove_update and a GuildBanRemoveEvent

Return type

Tuple[str, GuildBanRemoveEvent]

Guild Create#

guild_create_middleware#

await guild_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_create,

generate the guild class that was created

Parameters
  • payload (GatewayDispatch) – The data received from the guild create event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_create and a Guild

Return type

Tuple[str, Guild]

Guild Delete#

guild_delete_middleware#

await guild_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild delete event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_delete and an UnavailableGuild

Return type

Tuple[str, UnavailableGuild]

Guild Emojis Update#

guild_emojis_update_middleware#

await guild_emojis_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_emojis_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild emojis update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_emoji_update and a GuildEmojisUpdateEvent

Return type

Tuple[str, GuildEmojisUpdateEvent]

Guild Integrations Update#

guild_integrations_update_middleware#

await guild_integrations_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_integrations_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild integrations update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_integration_update and a GuildIntegrationsUpdateEvent

Return type

Tuple[str, GuildIntegrationsUpdateEvent]

Guild Members Chunk#

guild_member_chunk_middleware#

await guild_member_chunk_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_member_chunk event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild member chunk event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_member_chunk and a GuildMembersChunkEvent

Return type

Tuple[str, GuildMembersChunkEvent]

Guild Member Add#

guild_member_add_middleware#

await guild_member_add_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_member_add event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild member add event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_member_add and a GuildMemberAddEvent

Return type

Tuple[str, GuildMemberAddEvent]

Guild Member Remove#

guild_member_remove_middleware#

await guild_member_remove_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_member_remove event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild member remove event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_member_remove and a GuildMemberRemoveEvent

Return type

Tuple[str, GuildMemberRemoveEvent]

Guild Member Update#

guild_member_update_middleware#

await guild_member_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_member_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild member update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_member_update and a GuildMemberUpdateEvent

Return type

Tuple[str, GuildMemberUpdateEvent]

Guild Role Create#

guild_role_create_middleware#

await guild_role_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_role_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild role create event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_role_create and a GuildRoleCreateEvent

Return type

Tuple[str, GuildRoleCreateEvent]

Guild Role Delete#

guild_role_delete_middleware#

await guild_role_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_role_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild role delete event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_role_delete and a GuildRoleDeleteEvent

Return type

Tuple[str, GuildRoleDeleteEvent]

Guild Role Update#

guild_role_update_middleware#

await guild_role_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_role_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild role update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_role_update and a GuildRoleUpdateEvent

Return type

Tuple[str, GuildRoleUpdateEvent]

Guild Status#

guild_status_middleware#

await guild_status_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_status event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild status event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_status and a GuildStatusEvent

Return type

Tuple[str, GuildStatusEvent]

Guild Stickers Update#

guild_stickers_update_middleware#

await guild_stickers_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_stickers_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild stickers update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_sticker_update and a GuildStickersUpdateEvent

Return type

Tuple[str, GuildStickersUpdateEvent]

Guild Update#

guild_update_middleware#

await guild_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_guild_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the guild update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_guild_Update and an Guild

Return type

Tuple[str, Guild]

Integration Create#

integration_create_middleware#

await integration_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_integration_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the integration create event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_integration_create and an IntegrationCreateEvent

Return type

Tuple[str, IntegrationCreateEvent]

Integration Delete#

integration_delete_middleware#

await integration_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_integration_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the integration delete event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_integration_delete and an IntegrationDeleteEvent

Return type

Tuple[str, IntegrationDeleteEvent]

Integration Update#

integration_update_middleware#

await integration_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_integration_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the integration update event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_integration_update and an IntegrationUpdateEvent

Return type

Tuple[str, IntegrationUpdateEvent]

Interaction Create#

interaction_response_handler#

await interaction_response_handler(self, command, manager, context, interaction, args, kwargs)#

This function is a coroutine.

Handle any coroutine as a command.

Parameters
  • command (Coro) – The coroutine which will be seen as a command.

  • context (MessageContext) – The context of the command.

  • interaction (Interaction) – The interaction which is linked to the command.

  • **kwargs – The arguments to be passed to the command.

interaction_handler#

await interaction_handler(self, interaction, context, command, manager)#

This function is a coroutine.

Processes an interaction.

Parameters
  • interaction (Interaction) – The interaction which is linked to the command.

  • context (MessageContext) – The context of the command.

  • command (Coro) – The coroutine which will be seen as a command.

interaction_create_middleware#

await interaction_create_middleware(self, gateway, payload)#

Middleware for on_interaction, which handles command execution.

Parameters
  • payload (GatewayDispatch) – The data received from the interaction event.

  • gateway (Gateway) – The gateway for the current shard.

Raises

e – Generic try except on await interaction_handler and if 0 < len(params) < 3

Returns

on_interaction_create and an Interaction

Return type

Tuple[str, Interaction]

Invite Create#

invite_create_middleware#

await invite_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_invite_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the invite create event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_invite_create and an InviteCreateEvent

Return type

Tuple[str, InviteCreateEvent]

Invite Delete#

invite_delete_middleware#

await invite_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_invite_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the invite delete event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_invite_delete and an InviteDeleteEvent

Return type

Tuple[str, InviteDeleteEvent]

Message Create#

message_create_middleware#

await message_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message event.

Parameters
  • payload (pincer.core.gateway.GatewayDispatch) – The data received from the message creation event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message and a UserMessage

Return type

Tuple[str, UserMessage]

Message Delete#

on_message_delete_middleware#

await on_message_delete_middleware(self, gateway, payload)#

This function is a coroutine. Middleware for the on_message_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the message delete event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_delete and a MessageDeleteEvent

Return type

Tuple[str, MessageDeleteEvent]

Message Delete Bulk#

message_delete_bulk_middleware#

await message_delete_bulk_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message_delete_bulk event.

Parameters
  • payload (GatewayDispatch) – The data received from the message delete bulk event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_delete_bulk and an MessageDeleteBulkEvent

Return type

Tuple[str, MessageDeleteBulkEvent]

Message Reaction Add#

message_reaction_add_middleware#

await message_reaction_add_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message_reaction_add event.

Parameters
  • payload (GatewayDispatch) – The data received from the message reaction add event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_reaction_add and an MessageReactionAddEvent

Return type

Tuple[str, MessageReactionAddEvent]

Message Reaction Remove#

message_reaction_remove_middleware#

await message_reaction_remove_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message_reaction_remove event.

Parameters
  • payload (GatewayDispatch) – The data received from the message reaction remove event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_reaction_remove and an MessageReactionRemoveEvent

Return type

Tuple[str, MessageReactionRemoveEvent]

Message Reaction Remove All#

message_reaction_remove_all_middleware#

await message_reaction_remove_all_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message_reaction_remove_all event.

Parameters
  • payload (GatewayDispatch) – The data received from the message reaction remove all event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_reaction_remove_all and an MessageReactionRemoveAllEvent

Return type

Tuple[str, MessageReactionRemoveAllEvent]

Message Reaction Remove Emoji#

message_reaction_remove_emoji_middleware#

await message_reaction_remove_emoji_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message_reaction_remove_emoji event.

Parameters
  • payload (GatewayDispatch) – The data received from the message reaction remove emoji event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_reaction_remove_emoji and an MessageReactionRemoveEmojiEvent

Return type

Tuple[str, MessageReactionRemoveEmojiEvent]

Message Update#

message_update_middleware#

await message_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_message_update event.

generate a class for the message that has been updated.

Parameters
  • payload (GatewayDispatch) – The data received from the message update event event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_message_update and a UserMessage

Return type

Tuple[str, UserMessage]

Notification Create#

notification_create_middleware#

await notification_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_notification_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the notification create event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_notification_create and a NotificationCreateEvent

Return type

Tuple[str, NotificationCreateEvent]

Payload#

payload_middleware#

await payload_middleware(self, gateway, payload)#

Invoked when anything is received from gateway.

Parameters
  • payload (pincer.core.gateway.GatewayDispatch) – The data received from the ready event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_payload and a payload

Return type

Tuple[str, GatewayDispatch]

Presence Update#

presence_update_middleware#

await presence_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_presence_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the presence update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_presence_update and a PresenceUpdateEvent

Return type

Tuple[str, PresenceUpdateEvent]

Ready#

on_ready_middleware#

await on_ready_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_ready event.

Parameters
  • payload (GatewayDispatch) – The data received from the stage instance create event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_ready

Return type

Tuple[str]

Speaking Start#

speaking_start_middleware#

await speaking_start_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_speaking_start event.

Parameters
  • payload (GatewayDispatch) – The data received from the speaking start event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_speaking_start and a SpeakingStartEvent

Return type

Tuple[str, SpeakingStartEvent]

Speaking Stop#

speaking_stop_middleware#

await speaking_stop_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_speaking_stop event.

Parameters
  • payload (GatewayDispatch) – The data received from the speaking stop event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_speaking_stop and a Snowflake (user_id)

Return type

Tuple[str, Snowflake]

Stage Instance Create#

stage_instance_create_middleware#

await stage_instance_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_stage_instance_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the stage instance create event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_stage_instance_create and a StageInstance

Return type

Tuple[str, StageInstance]

Stage Instance Delete#

stage_instance_delete_middleware#

await stage_instance_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_stage_instance_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the stage instance delete event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_stage_instance_delete and a StageInstance

Return type

Tuple[str, StageInstance]

Stage Instance Update#

stage_instance_update_middleware#

await stage_instance_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_stage_instance_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the stage instance update event

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_stage_instance_update and a StageInstance

Return type

Tuple[str, StageInstance]

Thread Create#

thread_create_middleware#

await thread_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_thread_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the thread create event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_thread_create and an Channel

Return type

Tuple[str, Channel]

Thread Delete#

thread_delete_middleware#

await thread_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_thread_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the thread delete event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_thread_delete and an Channel

Return type

Tuple[str, Channel]

Thread List Sync#

thread_list_sync#

await thread_list_sync(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_thread_list_sync event.

Parameters
  • payload (GatewayDispatch) – The data received from the thread list sync event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_thread_list_sync and an ThreadListSyncEvent

Return type

Tuple[str, ThreadListSyncEvent]

Thread Members Update#

thread_members_update_middleware#

await thread_members_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_thread_members_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the thread members update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_thread_members_update and an ThreadMembersUpdateEvent

Return type

Tuple[str, ThreadMembersUpdateEvent]

Thread Member Update#

thread_member_update_middleware#

await thread_member_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_thread_member_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the thread member update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_thread_member_update and an ThreadMember

Return type

Tuple[str, ThreadMember]

Thread Update#

thread_update_middleware#

await thread_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_thread_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the thread update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_thread_update and an Channel

Return type

Tuple[str, Channel]

Typing Start#

typing_start_middleware#

await typing_start_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_typing_start event.

Parameters
  • payload (GatewayDispatch) – The data received from the typing start event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_typing_start and a TypingStartEvent

Return type

Tuple[str, TypingStartEvent]

User Update#

user_update_middleware#

await user_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_user_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the user update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_user_update and a User

Return type

Tuple[str, User]

Voice Channel Select#

voice_channel_select_middleware#

await voice_channel_select_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_voice_channel_select event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice channel select event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_channel_select and a VoiceChannelSelectEvent

Return type

Tuple[str, VoiceChannelSelectEvent]

Voice Connection Status#

voice_connection_status_middleware#

await voice_connection_status_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_voice_connection_status event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice connection status event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_connection_status and a VoiceConnectionStatusEvent

Return type

Tuple[str, VoiceConnectionStatusEvent]

Voice Server Update#

voice_server_update_middleware#

await voice_server_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_voice_server_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice server update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_server_update and a VoiceServerUpdateEvent

Return type

Tuple[str, VoiceServerUpdateEvent]

Voice Settings Update#

voice_settings_update_middleware#

await voice_settings_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_voice_settings_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice settings update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_settings_update and a VoiceSettingsUpdateEvent

Return type

Tuple[str, VoiceSettingsUpdateEvent]

Voice State Create#

voice_state_create_middleware#

await voice_state_create_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_voice_state_create event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice state create event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_state_create and a VoiceState

Return type

Tuple[str, VoiceState]

Voice State Delete#

voice_state_delete_middleware#

await voice_state_delete_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_voice_state_delete event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice state delete event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_state_delete and a VoiceState

Return type

Tuple[str, VoiceState]

Voice State Update#

voice_state_update_middleware#

await voice_state_update_middleware(self, gateway, payload)#

This function is a coroutine. Middleware for the on_voice_state_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the voice state update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_voice_state_update and a VoiceState

Return type

Tuple[str, VoiceState]

Webhooks Update#

webhooks_update_middleware#

await webhooks_update_middleware(self, gateway, payload)#

This function is a coroutine.

Middleware for the on_webhooks_update event.

Parameters
  • payload (GatewayDispatch) – The data received from the webhooks update event.

  • gateway (Gateway) – The gateway for the current shard.

Returns

on_webhooks_update and a WebhooksUpdateEvent

Return type

Tuple[str, WebhooksUpdateEvent]