-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mlnrDev
committed
Apr 13, 2024
1 parent
8a73887
commit e25946c
Showing
6 changed files
with
167 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package events | ||
|
||
import ( | ||
"github.com/disgoorg/snowflake/v2" | ||
) | ||
|
||
// GenericDMMessagePollVote is called upon receiving DMMessagePollVoteAdd or DMMessagePollVoteRemove (requires the gateway.IntentDirectMessagePolls) | ||
type GenericDMMessagePollVote struct { | ||
*GenericEvent | ||
UserID snowflake.ID | ||
ChannelID snowflake.ID | ||
MessageID snowflake.ID | ||
AnswerID int | ||
} | ||
|
||
// DMMessagePollVoteAdd indicates that a discord.User voted on a discord.Poll in a DM (requires gateway.IntentDirectMessagePolls) | ||
type DMMessagePollVoteAdd struct { | ||
*GenericDMMessagePollVote | ||
} | ||
|
||
// DMMessagePollVoteRemove indicates that a discord.User removed their vote on a discord.Poll in a DM (requires gateway.IntentDirectMessagePolls) | ||
type DMMessagePollVoteRemove struct { | ||
*GenericDMMessagePollVote | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package events | ||
|
||
import ( | ||
"github.com/disgoorg/disgo/discord" | ||
"github.com/disgoorg/snowflake/v2" | ||
) | ||
|
||
// GenericGuildMessagePollVote is called upon receiving GuildMessagePollVoteAdd or GuildMessagePollVoteRemove (requires the gateway.IntentGuildMessagePolls) | ||
type GenericGuildMessagePollVote struct { | ||
*GenericEvent | ||
UserID snowflake.ID | ||
ChannelID snowflake.ID | ||
MessageID snowflake.ID | ||
GuildID snowflake.ID | ||
AnswerID int | ||
} | ||
|
||
// Guild returns the discord.Guild where the GenericGuildMessagePollVote happened | ||
func (e *GenericGuildMessagePollVote) Guild() (discord.Guild, bool) { | ||
return e.Client().Caches().Guild(e.GuildID) | ||
} | ||
|
||
// GuildMessagePollVoteAdd indicates that a discord.User voted on a discord.Poll in a discord.Guild (requires gateway.IntentGuildMessagePolls) | ||
type GuildMessagePollVoteAdd struct { | ||
*GenericGuildMessagePollVote | ||
} | ||
|
||
// GuildMessagePollVoteRemove indicates that a discord.User removed their vote on a discord.Poll in a discord.Guild (requires gateway.IntentGuildMessagePolls) | ||
type GuildMessagePollVoteRemove struct { | ||
*GenericGuildMessagePollVote | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package events | ||
|
||
import ( | ||
"github.com/disgoorg/disgo/discord" | ||
"github.com/disgoorg/snowflake/v2" | ||
) | ||
|
||
// GenericMessagePollVote is a generic poll vote event (requires gateway.IntentGuildMessagePolls or gateway.IntentDirectMessagePolls) | ||
type GenericMessagePollVote struct { | ||
*GenericEvent | ||
UserID snowflake.ID | ||
ChannelID snowflake.ID | ||
MessageID snowflake.ID | ||
GuildID *snowflake.ID | ||
AnswerID int | ||
} | ||
|
||
// Guild returns the discord.Guild where the GenericMessagePoll happened or empty if it happened in DMs | ||
func (e *GenericMessagePollVote) Guild() (discord.Guild, bool) { | ||
if e.GuildID == nil { | ||
return discord.Guild{}, false | ||
} | ||
return e.Client().Caches().Guild(*e.GuildID) | ||
} | ||
|
||
// MessagePollVoteAdd indicates that a discord.User voted on a discord.Poll (requires gateway.IntentGuildMessagePolls or gateway.IntentDirectMessagePolls) | ||
type MessagePollVoteAdd struct { | ||
*GenericMessagePollVote | ||
} | ||
|
||
// MessagePollVoteRemove indicates that a discord.User removed their vote on a discord.Poll (requires gateway.IntentGuildMessagePolls or gateway.IntentDirectMessagePolls) | ||
type MessagePollVoteRemove struct { | ||
*GenericMessagePollVote | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters