Adding debug

This commit is contained in:
AllfatherHatt 2025-02-23 20:56:33 +01:00
parent b4e4437171
commit 316ff36b8f

View File

@ -51,11 +51,10 @@ class ReginaldCog(commands.Cog):
)
@commands.Cog.listener()
async def on_message(self, message):
async def on_message(self, message, ctx):
if message.author.bot or not message.guild:
return # Ignore bots and DMs
await self.bot.process_commands(message) # ✅ Ensure commands still work
guild = message.guild
channel_id = str(message.channel.id)
@ -66,6 +65,7 @@ class ReginaldCog(commands.Cog):
# ✅ Fetch the stored listening channel or fall back to default
allowed_channel_id = await self.config.guild(guild).listening_channel()
if not allowed_channel_id:
ctx.send("<deciding channel is not cool>")
allowed_channel_id = self.default_listening_channel
await self.config.guild(guild).listening_channel.set(allowed_channel_id)
@ -98,6 +98,7 @@ class ReginaldCog(commands.Cog):
explicit_invocation = False
else:
ctx.send("<decided not to interject>")
return # Ignore irrelevant messages
# ✅ Context Handling: Maintain conversation flow