From e72dc8ecbd1a3619b1e940b3dd9e6a6e15bba778 Mon Sep 17 00:00:00 2001 From: Kingston-SCYD Date: Sun, 16 Aug 2026 22:58:09 -0500 Subject: [PATCH] Add debug logging to on_message listener --- assistant/assistant.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assistant/assistant.py b/assistant/assistant.py index af70cd8..bc26778 100644 --- a/assistant/assistant.py +++ b/assistant/assistant.py @@ -1,8 +1,11 @@ +import logging import aiohttp import discord from redbot.core import commands, Config, checks from redbot.core.bot import Red +log = logging.getLogger("red.assistant") + class APIKeyModal(discord.ui.Modal): def __init__(self, config): @@ -68,6 +71,7 @@ class Assistant(commands.Cog): if message.author.bot: return if not isinstance(message.channel, discord.TextChannel): + log.debug("Not a TextChannel: %s", type(message.channel)) return guild = message.guild @@ -76,10 +80,12 @@ class Assistant(commands.Cog): enabled = await self.config.guild(guild).enabled() if not enabled: + log.debug("Assistant disabled for guild %s", guild.id) return api_key = await self.config.api_key() if not api_key: + log.debug("No API key set") return chat_channel_id = await self.config.guild(guild).chat_channel() @@ -88,6 +94,8 @@ class Assistant(commands.Cog): is_chat_channel = chat_channel_id and message.channel.id == chat_channel_id is_ping = self.bot.user in message.mentions + log.debug("is_chat_channel=%s, is_ping=%s, mentions=%s", is_chat_channel, is_ping, message.mentions) + if not is_chat_channel and not is_ping: return