Skip to content

Commit

Permalink
fix: Ignore reactions to own messages
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira committed Jul 7, 2024
1 parent 5e29710 commit ae9ab6c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,21 @@ async def on_raw_reaction_add(self, payload: RawReactionActionEvent):
if payload.emoji.name == "💀":
channel = self.get_channel(payload.channel_id)
message = await channel.fetch_message(payload.message_id)
await self.skullboard_manager.handle_skullboard(
message, SKULLBOARD_CHANNEL_ID, "ADD"
)
# Ignore reactions to own messages
if message.author.id != self.user.id:
await self.skullboard_manager.handle_skullboard(
message, SKULLBOARD_CHANNEL_ID, "ADD"
)

async def on_raw_reaction_remove(self, payload: RawReactionActionEvent):
if payload.emoji.name == "💀":
channel = self.get_channel(payload.channel_id)
message = await channel.fetch_message(payload.message_id)
await self.skullboard_manager.handle_skullboard(
message, SKULLBOARD_CHANNEL_ID, "REMOVE"
)
# Ignore reactions to own messages
if message.author.id != self.user.id:
await self.skullboard_manager.handle_skullboard(
message, SKULLBOARD_CHANNEL_ID, "REMOVE"
)


client = DuckBot()
Expand Down

0 comments on commit ae9ab6c

Please sign in to comment.