Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(discord): correct group_policy default to mention and style cleanup
Re-bin06fcd2cc3fed
diff --git a/nanobot/channels/discord.py b/nanobot/channels/discord.pyindex 85ff28a3f..900c17b15 100644--- a/nanobot/channels/discord.py+++ b/nanobot/channels/discord.py@@ -174,7 +174,7 @@ class DiscordChannel(BaseChannel):# Capture bot user ID for mention detectionuser_data = payload.get("user") or {}self._bot_user_id = user_data.get("id")- logger.info(f"Discord bot connected as user {self._bot_user_id}")+ logger.info("Discord bot connected as user {}", self._bot_user_id)elif op == 0 and event_type == "MESSAGE_CREATE":await self._handle_message_create(payload)elif op == 7:@@ -287,8 +287,6 @@ class DiscordChannel(BaseChannel):def _should_respond_in_group(self, payload: dict[str, Any], content: str) -> bool:"""Check if bot should respond in a group channel based on policy."""- channel_id = str(payload.get("channel_id", ""))-if self.config.group_policy == "open":return True@@ -303,7 +301,7 @@ class DiscordChannel(BaseChannel):# Also check content for mention format <@USER_ID>if f"<@{self._bot_user_id}>" in content or f"<@!{self._bot_user_id}>" in content:return True- logger.debug(f"Discord message in {channel_id} ignored (bot not mentioned)")+ logger.debug("Discord message in {} ignored (bot not mentioned)", payload.get("channel_id"))return Falsereturn Truediff --git a/nanobot/config/schema.py b/nanobot/config/schema.pyindex a6b609bf8..9d7da3bf2 100644--- a/nanobot/config/schema.py+++ b/nanobot/config/schema.py@@ -62,7 +62,7 @@ class DiscordConfig(Base):allow_from: list[str] = Field(default_factory=list) # Allowed user IDsgateway_url: str = "wss://gateway.discord.gg/?v=10&encoding=json"intents: int = 37377 # GUILDS + GUILD_MESSAGES + DIRECT_MESSAGES + MESSAGE_CONTENT- group_policy: str = "open" # "mention" or "open"+ group_policy: Literal["mention", "open"] = "mention"class MatrixConfig(Base):