Pincer Middleware Module#
Activity Join#
activity_join_middleware#
Activity Join Request#
activity_join_request_middleware#
Activity Spectate#
activity_spectate_middleware#
Channel Create#
channel_create_middleware#
Channel Delete#
channel_delete_middleware#
Channel Pins Update#
channel_pins_update_middleware#
Channel Update#
channel_update_middleware#
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 aDiscordError
- Return type
Tuple[
str
,DiscordError
]
Guild Ban Add#
guild_ban_add_middleware#
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 aGuildBanRemoveEvent
- Return type
Tuple[
str
,GuildBanRemoveEvent
]
Guild Create#
guild_create_middleware#
Guild Delete#
guild_delete_middleware#
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 aGuildEmojisUpdateEvent
- 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 aGuildIntegrationsUpdateEvent
- 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 aGuildMembersChunkEvent
- Return type
Tuple[
str
,GuildMembersChunkEvent
]
Guild Member Add#
guild_member_add_middleware#
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 aGuildMemberRemoveEvent
- 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 aGuildMemberUpdateEvent
- 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 aGuildRoleCreateEvent
- 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 aGuildRoleDeleteEvent
- 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 aGuildRoleUpdateEvent
- Return type
Tuple[
str
,GuildRoleUpdateEvent
]
Guild Status#
guild_status_middleware#
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 aGuildStickersUpdateEvent
- Return type
Tuple[
str
,GuildStickersUpdateEvent
]
Guild Update#
guild_update_middleware#
Integration Create#
integration_create_middleware#
Integration Delete#
integration_delete_middleware#
Integration Update#
integration_update_middleware#
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
andif 0 < len(params) < 3
- Returns
on_interaction_create
and anInteraction
- 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 eventgateway (
Gateway
) – The gateway for the current shard.
- Returns
on_invite_create
and anInviteCreateEvent
- Return type
Tuple[
str
,InviteCreateEvent
]
Invite Delete#
invite_delete_middleware#
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 aUserMessage
- 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 eventgateway (
Gateway
) – The gateway for the current shard.
- Returns
on_message_delete
and aMessageDeleteEvent
- Return type
Tuple[
str
,MessageDeleteEvent
]
Message Delete Bulk#
message_delete_bulk_middleware#
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 anMessageReactionAddEvent
- 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 anMessageReactionRemoveEvent
- 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 anMessageReactionRemoveAllEvent
- 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 anMessageReactionRemoveEmojiEvent
- 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 eventgateway (
Gateway
) – The gateway for the current shard.
- Returns
on_message_update
and aUserMessage
- Return type
Tuple[
str
,UserMessage
]
- Middleware for the
Notification Create#
notification_create_middleware#
Payload#
payload_middleware#
- await payload_middleware(self, gateway, payload)#
Invoked when anything is received from gateway.
Presence Update#
presence_update_middleware#
Ready#
on_ready_middleware#
Speaking Start#
speaking_start_middleware#
Speaking Stop#
speaking_stop_middleware#
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 eventgateway (
Gateway
) – The gateway for the current shard.
- Returns
on_stage_instance_create
and aStageInstance
- 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 eventgateway (
Gateway
) – The gateway for the current shard.
- Returns
on_stage_instance_delete
and aStageInstance
- 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 eventgateway (
Gateway
) – The gateway for the current shard.
- Returns
on_stage_instance_update
and aStageInstance
- Return type
Tuple[
str
,StageInstance
]
Thread Create#
thread_create_middleware#
Thread Delete#
thread_delete_middleware#
Thread List Sync#
thread_list_sync#
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 anThreadMembersUpdateEvent
- 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 anThreadMember
- Return type
Tuple[
str
,ThreadMember
]
Thread Update#
thread_update_middleware#
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 aTypingStartEvent
- Return type
Tuple[
str
,TypingStartEvent
]
User Update#
user_update_middleware#
Voice Channel Select#
voice_channel_select_middleware#
Voice Connection Status#
voice_connection_status_middleware#
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 aVoiceServerUpdateEvent
- Return type
Tuple[
str
,VoiceServerUpdateEvent
]
Voice Settings Update#
voice_settings_update_middleware#
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 aVoiceState
- 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 aVoiceState
- 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 aVoiceState
- 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 aWebhooksUpdateEvent
- Return type
Tuple[
str
,WebhooksUpdateEvent
]