fixed bug where llama sometimes wasnt enabled or disabled

This commit is contained in:
phixxy 2024-06-18 23:01:02 -07:00
parent 995bb08a0a
commit 49c10f0bf5

View file

@ -159,11 +159,14 @@ class Llama(commands.Cog):
channel_vars = await self.get_channel_config(message.channel.id) channel_vars = await self.get_channel_config(message.channel.id)
chat_history_string = await self.log_chat_and_get_history(message, logfile, channel_vars) chat_history_string = await self.log_chat_and_get_history(message, logfile, channel_vars)
# Chat Response # Chat Response
if channel_vars["llama_enabled"] and not message.author.bot or self.bot_id in [x.id for x in message.mentions]: try:
if message.content and message.content[0] != "!": if channel_vars["llama_enabled"] and not message.author.bot or self.bot_id in [x.id for x in message.mentions]:
await self.chat_response(message, channel_vars, chat_history_string) if message.content and message.content[0] != "!":
elif not message.content: await self.chat_response(message, channel_vars, chat_history_string)
await self.chat_response(message, channel_vars, chat_history_string) elif not message.content:
await self.chat_response(message, channel_vars, chat_history_string)
except:
self.edit_channel_config(message.channel.id, "llama_enabled", False)
async def setup(bot): async def setup(bot):