Debugging listening

This commit is contained in:
AllfatherHatt 2025-02-23 20:34:58 +01:00
parent a7c0b90036
commit b4e4437171

View File

@ -52,10 +52,10 @@ class ReginaldCog(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_message(self, message): async def on_message(self, message):
"""Handles @mentions, passive listening, and smart responses.""" if message.author.bot or not message.guild:
return # Ignore bots and DMs
if message.author.bot: await self.bot.process_commands(message) # ✅ Ensure commands still work
return # Ignore bots
guild = message.guild guild = message.guild
channel_id = str(message.channel.id) channel_id = str(message.channel.id)
@ -65,9 +65,9 @@ class ReginaldCog(commands.Cog):
# ✅ Fetch the stored listening channel or fall back to default # ✅ Fetch the stored listening channel or fall back to default
allowed_channel_id = await self.config.guild(guild).listening_channel() allowed_channel_id = await self.config.guild(guild).listening_channel()
if allowed_channel_id is None: if not allowed_channel_id:
allowed_channel_id = self.default_listening_channel # 🔹 Apply default if none is set allowed_channel_id = self.default_listening_channel
await self.config.guild(guild).listening_channel.set(allowed_channel_id) # 🔹 Store it persistently await self.config.guild(guild).listening_channel.set(allowed_channel_id)
if str(message.channel.id) != str(allowed_channel_id): if str(message.channel.id) != str(allowed_channel_id):
return # Ignore messages outside the allowed channel return # Ignore messages outside the allowed channel
@ -294,7 +294,7 @@ class ReginaldCog(commands.Cog):
response = await client.chat.completions.create( response = await client.chat.completions.create(
model=model, model=model,
messages=messages, messages=messages,
max_tokens=4112, max_tokens=2048,
temperature=0.7, temperature=0.7,
presence_penalty=0.5, presence_penalty=0.5,
frequency_penalty=0.5 frequency_penalty=0.5