Skip to content

Commit

Permalink
only delete self upvoted messages in memes chat
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleRush committed Nov 12, 2024
1 parent c6fd1b6 commit cdb1c51
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ETHDINFKBot/Handlers/ReactionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ public async void Run()

private async void PeopleUpvotingTheirOwnMessages(Emote reactionEmote)
{
List<ulong> upvoteChannels = new List<ulong>()
{
DiscordChannels["memes"],
DiscordChannels["ethmemes"]
};

try
{
if (SocketGuildMessageUser.Id == SocketGuildReactionUser.Id && reactionEmote.Id == DiscordEmotes["this"])
if (upvoteChannels.Contains(SocketGuildChannel.Id) && SocketGuildMessageUser.Id == SocketGuildReactionUser.Id && reactionEmote.Id == DiscordEmotes["this"])
{
// delete the the message
await Message.DeleteAsync();
Expand Down

0 comments on commit cdb1c51

Please sign in to comment.