diff --git a/ai_commands.py b/ai_commands.py index d044f06..25a62c8 100644 --- a/ai_commands.py +++ b/ai_commands.py @@ -218,18 +218,18 @@ class Events(commands.Cog): await discord_friendly_send(channel, "Słyszałem ja żem że: " + message.content) return channel = message.channel - message.content = message.content.lower() + message_content_lower = message.content.lower() tdelta = datetime.now() - MASTER_TIMEOUT tdelta = tdelta.total_seconds() - if "opowiedz o fabryczce" in message.content: + if "opowiedz o fabryczce" in message_content_lower: await message.reply(DATA["fabryczka"]) - if "opowiedz mi o fabryczce" in message.content: + if "opowiedz mi o fabryczce" in message_content_lower: await message.reply(DATA["fabryczka"]) if tdelta > INITIAL_TIME_WAIT: for word in WORD_REACTIONS: - if re.search(r"\b" + word + r"\b", message.content): + if re.search(r"\b" + word + r"\b", message_content_lower): tdelta = datetime.now() - WORD_REACTIONS[word][2] tdelta = tdelta.total_seconds() security_clearance = WORD_REACTIONS[word][4] @@ -252,11 +252,11 @@ class Events(commands.Cog): if mention == self.bot.user: kondziu_mentioned = True - if kondziu_mentioned or "conjurer:" in message.content: + if kondziu_mentioned or "conjurer:" in message_content_lower: async with channel.typing(): self.logger.debug("Procedura chatu") - message.content = message.content.replace("conjurer: ", "") + message_content_lower = message_content_lower.replace("conjurer: ", "") if message.author.nick: username = message.author.nick else: @@ -292,8 +292,8 @@ class Events(commands.Cog): if "imaginuje sobie:" in message.content: async with channel.typing(): self.logger.info("Poczatek procedury obrazkowej") - message.content = message.content.replace("imaginuje sobie: ", "") - self.logger.debug("Wywolanie obrazka: %s", message.content) + message_content_lower = message_content_lower.replace("imaginuje sobie: ", "") + self.logger.debug("Wywolanie obrazka: %s", message_content_lower) try: response = await OPENAICLIENT.images.generate( model="dall-e-3",