Skip to content

Commit

Permalink
Do not react to bots
Browse files Browse the repository at this point in the history
  • Loading branch information
greenaar committed Apr 22, 2024
1 parent c9607ea commit 5ffa5eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/err-backend-discord/err-backend-discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ async def on_message(self, msg: discord.Message):
"""
err_msg = Message(msg.content, extras=msg.embeds)

# if the message coming in is from a webhook, it will not have a username
# this will cause the whole process to fail. In those cases, return without
# processing.

if msg.author.bot:
return

if isinstance(msg.channel, discord.abc.PrivateChannel):
err_msg.frm = DiscordPerson(msg.author.id)
err_msg.to = self.bot_identifier
Expand Down

0 comments on commit 5ffa5eb

Please sign in to comment.