Skip to content

Commit

Permalink
Fix delete permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
amadejkastelic committed Jul 3, 2024
1 parent 6c32a50 commit b404028
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bots/discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ async def on_click(
interaction: discord.Interaction,
button: ui.Button,
) -> None:
await interaction.message.delete()
if interaction.user.mentioned_in(interaction.message):
await interaction.message.delete()
logging.info(f'User {interaction.user.id} performed a delete action')
else:
logging.warning(
f'User {interaction.user.id} tried to perform an illegal delete action on {interaction.message.id}'
)


class DiscordClient(discord.Client):
Expand Down

0 comments on commit b404028

Please sign in to comment.