From d4347e2aacef4dfdd513ba5d73396a4d4a876ee2 Mon Sep 17 00:00:00 2001 From: wookie184 Date: Tue, 7 Oct 2025 22:04:25 +0200 Subject: [PATCH] Fix incorrect variable used in mentions logic resolved is always None here, as the logic is for the case when resolved is None. Instead we want to use the channel and message ID from ref directly, which are always defined here --- bot/exts/filtering/_filters/antispam/mentions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/exts/filtering/_filters/antispam/mentions.py b/bot/exts/filtering/_filters/antispam/mentions.py index 6d541a28c9..1f26163284 100644 --- a/bot/exts/filtering/_filters/antispam/mentions.py +++ b/bot/exts/filtering/_filters/antispam/mentions.py @@ -68,8 +68,8 @@ async def triggered_on(self, ctx: FilterContext) -> bool: # that is both not in the cache, and deleted while running this function. # In such a situation, this will throw an error which we catch. try: - resolved = await bot.instance.get_partial_messageable(resolved.channel_id).fetch_message( - resolved.message_id + resolved = await bot.instance.get_partial_messageable(ref.channel_id).fetch_message( + ref.message_id ) except NotFound: log.info("Could not fetch the reference message as it has been deleted.")