Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tux/cogs/services/bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) ->
if payload.emoji.name in self.add_bookmark_emojis:
await self.add_bookmark(user, message)

# If the emoji is the remove bookmark emoji, remove the bookmark
elif payload.emoji.name in self.remove_bookmark_emojis:
# Ensures were in a users DMs before removing (to fix an issue with being able to remove messages anywhere)
if not isinstance(channel, discord.DMChannel):
return

# If the emoji is the remove bookmark emoji and reaction is on the bot, remove the bookmark
if payload.emoji.name in self.remove_bookmark_emojis and message.author is self.bot.user:
await self.remove_bookmark(message)

async def add_bookmark(self, user: discord.User, message: discord.Message) -> None:
Expand Down