feat(wecom): add wecom channel [wobsocket]

support text/audio[wecom support audio message by default]
This commit is contained in:
chengyongru
2026-03-09 22:00:45 +08:00
parent 998021f571
commit a660a25504
4 changed files with 375 additions and 1 deletions

View File

@@ -7,7 +7,6 @@ from typing import Any
from loguru import logger
from nanobot.bus.events import OutboundMessage
from nanobot.bus.queue import MessageBus
from nanobot.channels.base import BaseChannel
from nanobot.config.schema import Config
@@ -150,6 +149,19 @@ class ChannelManager:
except ImportError as e:
logger.warning("Matrix channel not available: {}", e)
# WeCom channel
if self.config.channels.wecom.enabled:
try:
from nanobot.channels.wecom import WecomChannel
self.channels["wecom"] = WecomChannel(
self.config.channels.wecom,
self.bus,
groq_api_key=self.config.providers.groq.api_key,
)
logger.info("WeCom channel enabled")
except ImportError as e:
logger.warning("WeCom channel not available: {}", e)
self._validate_allow_from()
def _validate_allow_from(self) -> None: