diff --git a/lib/nostrum/consumer.ex b/lib/nostrum/consumer.ex index 78f45429c..a1181e866 100644 --- a/lib/nostrum/consumer.ex +++ b/lib/nostrum/consumer.ex @@ -83,6 +83,7 @@ defmodule Nostrum.Consumer do MessageReactionRemove, MessageReactionRemoveAll, MessageReactionRemoveEmoji, + PollVoteChange, Ready, SpeakingUpdate, ThreadListSync, @@ -325,6 +326,17 @@ defmodule Nostrum.Consumer do Dispatched when member(s) are added or removed from a thread """ @type thread_members_update :: {:THREAD_MEMBERS_UPDATE, ThreadMembersUpdate.t(), WSState.t()} + + @typedoc """ + Dispatched when a user adds a vote to a poll. + """ + @type message_poll_vote_add :: {:MESSAGE_POLL_VOTE_ADD, PollVoteChange.t(), WSState.t()} + + @typedoc """ + Dispatched when a user removes a vote from a poll. + """ + @type message_poll_vote_remove :: {:MESSAGE_POLL_VOTE_REMVE, PollVoteChange.t(), WSState.t()} + @type event :: auto_moderation_rule_create | auto_moderation_rule_delete @@ -364,6 +376,8 @@ defmodule Nostrum.Consumer do | message_reaction_remove | message_reaction_remove_all | message_ack + | message_poll_vote_add + | message_poll_vote_remove | presence_update | ready | resumed diff --git a/lib/nostrum/struct/event/poll_vote_change.ex b/lib/nostrum/struct/event/poll_vote_change.ex index a87674e77..3a0b6176b 100644 --- a/lib/nostrum/struct/event/poll_vote_change.ex +++ b/lib/nostrum/struct/event/poll_vote_change.ex @@ -26,6 +26,16 @@ defmodule Nostrum.Struct.Event.PollVoteChange do @typedoc "Whether the vote was an add or removal for the option" @type type :: :add | :remove + @typedoc "Event representing a add/removal of a vote from a poll" + @type t :: %__MODULE__{ + user_id: user_id, + channel_id: channel_id, + message_id: message_id, + guild_id: guild_id, + answer_id: answer_id, + type: type + } + @doc false def to_struct(map) do new =