From 0a4afc9ee45aba38b7a403f66230d832633113f8 Mon Sep 17 00:00:00 2001 From: cherry <102343489+cherryl1k@users.noreply.github.com> Date: Sat, 26 Jul 2025 09:31:09 -0500 Subject: [PATCH 1/2] fix: Prevents tux from deleting messages outside of DMs --- tux/cogs/services/bookmarks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tux/cogs/services/bookmarks.py b/tux/cogs/services/bookmarks.py index 3e453b761..cda70b8ad 100644 --- a/tux/cogs/services/bookmarks.py +++ b/tux/cogs/services/bookmarks.py @@ -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) + # 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, remove the bookmark - elif payload.emoji.name in self.remove_bookmark_emojis: + if payload.emoji.name in self.remove_bookmark_emojis: await self.remove_bookmark(message) async def add_bookmark(self, user: discord.User, message: discord.Message) -> None: From 79f4e4740a302c9a7ac045a3b82ab5f5265458db Mon Sep 17 00:00:00 2001 From: cherry <102343489+cherryl1k@users.noreply.github.com> Date: Sat, 26 Jul 2025 09:44:21 -0500 Subject: [PATCH 2/2] fix: added a additional check for saftey --- tux/cogs/services/bookmarks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tux/cogs/services/bookmarks.py b/tux/cogs/services/bookmarks.py index cda70b8ad..7f3c3e2bb 100644 --- a/tux/cogs/services/bookmarks.py +++ b/tux/cogs/services/bookmarks.py @@ -77,8 +77,8 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) -> if not isinstance(channel, discord.DMChannel): return - # If the emoji is the remove bookmark emoji, remove the bookmark - if payload.emoji.name in self.remove_bookmark_emojis: + # 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: