From 194d4c3c844b161a8742614b51dd988061ad335f Mon Sep 17 00:00:00 2001 From: Mifuyu Date: Fri, 17 May 2024 22:23:09 +0700 Subject: [PATCH] Add polls gateway events --- discord_typings/_gateway.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/discord_typings/_gateway.py b/discord_typings/_gateway.py index d9c308a..6324aaa 100644 --- a/discord_typings/_gateway.py +++ b/discord_typings/_gateway.py @@ -165,6 +165,10 @@ 'StageInstanceUpdateEvent', 'StageInstanceDeleteData', 'StageInstanceDeleteEvent', + 'MessagePollVoteAddData', + 'MessagePollVoteAddEvent', + 'MessagePollVoteRemoveData', + 'MessagePollVoteRemoveEvent', 'DispatchEvent', 'GatewayCommand', 'GatewayEvent', @@ -1301,6 +1305,38 @@ class WebhooksUpdateData(TypedDict): ] +# https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add + + +class MessagePollVoteAddData(TypedDict): + user_id: 'discord_typings.Snowflake' + channel_id: 'discord_typings.Snowflake' + message_id: 'discord_typings.Snowflake' + guild_id: NotRequired['discord_typings.Snowflake'] + answer_id: int + + +MessagePollVoteAddEvent = GenericDispatchEvent[ + Literal['MESSAGE_POLL_VOTE_ADD'], MessagePollVoteAddData +] + + +# https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove + + +class MessagePollVoteRemoveData(TypedDict): + user_id: 'discord_typings.Snowflake' + channel_id: 'discord_typings.Snowflake' + message_id: 'discord_typings.Snowflake' + guild_id: NotRequired['discord_typings.Snowflake'] + answer_id: int + + +MessagePollVoteRemoveEvent = GenericDispatchEvent[ + Literal['MESSAGE_POLL_VOTE_REMOVE'], MessagePollVoteRemoveData +] + + # Generalized unions for the typings in this file