Skip to content

Commit 9142737

Browse files
committed
Fix bot starring own messages
Turns out I'm a fucking idiot : )))
1 parent 3981e22 commit 9142737

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bot/starboard.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,11 @@ async def _star_message(self, message: discord.Message, title: str) -> None:
3939

4040
@commands.Cog.listener()
4141
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
42+
4243
STAR = "⭐"
4344
if payload.emoji.name != STAR:
4445
return
4546

46-
assert self.bot.user is not None # Shut LSP up
47-
if payload.user_id == self.bot.user.id:
48-
return
49-
5047
if payload.message_id in self.storage.get_starred_messages():
5148
return
5249

@@ -55,6 +52,11 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
5552
return
5653

5754
message = await channel.fetch_message(payload.message_id)
55+
56+
assert self.bot.user is not None # Shut LSP up
57+
if message.author.id == self.bot.user.id:
58+
return
59+
5860
stars = [ r for r in message.reactions if r.emoji == STAR].pop().count
5961
if stars < config.STARBOARD_MINIMUM_STARS:
6062
return

0 commit comments

Comments
 (0)