From 5ffa5eb38722c6d861d8cf5457d95390f8312a04 Mon Sep 17 00:00:00 2001 From: Aaron Greengrass Date: Mon, 22 Apr 2024 14:04:44 -0700 Subject: [PATCH] Do not react to bots --- src/err-backend-discord/err-backend-discord.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/err-backend-discord/err-backend-discord.py b/src/err-backend-discord/err-backend-discord.py index 5d1996c..8fe3179 100644 --- a/src/err-backend-discord/err-backend-discord.py +++ b/src/err-backend-discord/err-backend-discord.py @@ -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