diff --git a/fjerkroa_bot/discord_bot.py b/fjerkroa_bot/discord_bot.py index 64d59bd..64b02a2 100644 --- a/fjerkroa_bot/discord_bot.py +++ b/fjerkroa_bot/discord_bot.py @@ -68,7 +68,11 @@ class FjerkroaBot(commands.Bot): await self.respond(msg, message.channel) async def respond(self, message: AIMessage, channel: TextChannel) -> None: - logging.info(f"handle message {str(message)} for channel {channel.name}") + try: + channel_name = channel.name + except Exception: + channel_name = str(channel.id) + logging.info(f"handle message {str(message)} for channel {channel_name}") async with channel.typing(): response = await self.airesponder.send(message) if response.hack: