diff --git a/fjerkroa_bot/ai_responder.py b/fjerkroa_bot/ai_responder.py index 338a225..27cc6df 100644 --- a/fjerkroa_bot/ai_responder.py +++ b/fjerkroa_bot/ai_responder.py @@ -40,7 +40,7 @@ class AIResponder(object): def _message(self, message: AIMessage, limit: Optional[int] = None) -> List[Dict[str, Any]]: messages = [] system = self.config["system"].replace('{date}', time.strftime('%Y-%m-%d'))\ - .replace('{time}', time.strftime('%H-%M-%S')) + .replace('{time}', time.strftime('%H:%M:%S')) messages.append({"role": "system", "content": system}) if limit is None: history = self.history[:] diff --git a/fjerkroa_bot/discord_bot.py b/fjerkroa_bot/discord_bot.py index 8e9a3a3..64d59bd 100644 --- a/fjerkroa_bot/discord_bot.py +++ b/fjerkroa_bot/discord_bot.py @@ -71,14 +71,15 @@ class FjerkroaBot(commands.Bot): logging.info(f"handle message {str(message)} for channel {channel.name}") async with channel.typing(): response = await self.airesponder.send(message) + if response.hack: + logging.warning(f"User {message.user} tried to hack the system.") + if response.staff is None: + response.staff = f"User {message.user} try to hack the AI." if response.staff is not None and self.staff_channel is not None: async with self.staff_channel.typing(): await self.staff_channel.send(response.staff) if not response.answer_needed: return - if response.hack: - logging.warning(f"User {message.user} tried to hack the system.") - return if response.picture is not None: images = [discord.File(fp=await self.airesponder.draw(response.picture), filename="image.png")] await channel.send(response.answer, files=images)