Skip to content

Commit 0a4afc9

Browse files
fix: Prevents tux from deleting messages outside of DMs
1 parent dca3492 commit 0a4afc9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tux/cogs/services/bookmarks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent) ->
7373
if payload.emoji.name in self.add_bookmark_emojis:
7474
await self.add_bookmark(user, message)
7575

76+
# Ensures were in a users DMs before removing (to fix an issue with being able to remove messages anywhere)
77+
if not isinstance(channel, discord.DMChannel):
78+
return
79+
7680
# If the emoji is the remove bookmark emoji, remove the bookmark
77-
elif payload.emoji.name in self.remove_bookmark_emojis:
81+
if payload.emoji.name in self.remove_bookmark_emojis:
7882
await self.remove_bookmark(message)
7983

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

0 commit comments

Comments
 (0)