Skip to content

Commit

Permalink
Don't allow replies to system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
yiays committed Sep 9, 2024
1 parent eb8633c commit c6a834a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions babel/confessionbot_en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ channelprompt_button_next = Next Page
editor_title = Anonymous message editor
editor_message_label = Message:
editor_message_placeholder = The text that will become your anonymous message
confession_reply_failed = Unable to reply to messages of this type. Try replying to another message.
confession_sent_channel = Done, your message has been sent to {channel}.
confession_sent_below = Done, your message is below.
confession_vetting = Your message will now go through the vetting process, if approved, it will appear in {channel}.
Expand Down
4 changes: 3 additions & 1 deletion extensions/confessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ async def confession_request(self, msg:disnake.Message):
@commands.message_command(name="Confession Reply", dm_permission=False)
async def confess_message(self, inter:disnake.MessageCommandInteraction):
""" Shorthand to start a confession modal in this channel """
print(inter.target.id)
if inter.target.is_system():
await inter.send(self.babel(inter, 'confession_reply_failed'), ephemeral=True)
return
await self.confess(inter, None, None, reference=inter.target)

# Slash commands
Expand Down

0 comments on commit c6a834a

Please sign in to comment.