From 399b36b8caa5dafc86802cbb27489416244757ec Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Jul 2024 19:39:13 +0100 Subject: [PATCH] Don't log for "Not Found" webhooks where TIldy is the author --- botto/tld_botto.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/botto/tld_botto.py b/botto/tld_botto.py index 40dc13b..3d6a7d0 100644 --- a/botto/tld_botto.py +++ b/botto/tld_botto.py @@ -443,7 +443,10 @@ async def on_message(self, message: Message): webhook = await self.fetch_webhook(webhook_id) if webhook.type != discord.WebhookType.incoming: return - except discord.NotFound | discord.Forbidden: + except discord.NotFound: + if message.author.id == self.user.id: + return + except discord.Forbidden: pass if message.author.id == self.user.id: log.debug(f"Ignoring message {message.id} from self")