feat(channels): add Moltchat websocket channel with polling fallback

This commit is contained in:
tjb-tech
2026-02-09 08:46:47 +00:00
parent 625fc60282
commit 20b8a2fc58
8 changed files with 1459 additions and 4 deletions

View File

@@ -2,5 +2,6 @@
from nanobot.channels.base import BaseChannel
from nanobot.channels.manager import ChannelManager
from nanobot.channels.moltchat import MoltchatChannel
__all__ = ["BaseChannel", "ChannelManager"]
__all__ = ["BaseChannel", "ChannelManager", "MoltchatChannel"]

View File

@@ -77,6 +77,18 @@ class ChannelManager:
logger.info("Feishu channel enabled")
except ImportError as e:
logger.warning(f"Feishu channel not available: {e}")
# Moltchat channel
if self.config.channels.moltchat.enabled:
try:
from nanobot.channels.moltchat import MoltchatChannel
self.channels["moltchat"] = MoltchatChannel(
self.config.channels.moltchat, self.bus
)
logger.info("Moltchat channel enabled")
except ImportError as e:
logger.warning(f"Moltchat channel not available: {e}")
async def start_all(self) -> None:
"""Start WhatsApp channel and the outbound dispatcher."""

1227
nanobot/channels/moltchat.py Normal file

File diff suppressed because it is too large Load Diff