Skip to content

Commit

Permalink
Merge pull request #68 from greenaar/ignore-bots
Browse files Browse the repository at this point in the history
Do not react to bots
  • Loading branch information
nzlosh authored Apr 22, 2024
2 parents c9607ea + 5ffa5eb commit da8e41d
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 da8e41d

Please sign in to comment.