Initialize Matrix channel in ChannelManager when enabled in config

This commit is contained in:
Tanish Rajput
2026-02-27 11:39:01 +05:30
parent cab901b2fb
commit 568a54ae3e
2 changed files with 31 additions and 0 deletions
+12
View File
@@ -136,6 +136,18 @@ class ChannelManager:
logger.info("QQ channel enabled")
except ImportError as e:
logger.warning("QQ channel not available: {}", e)
# Matrix channel
if self.config.channels.matrix.enabled:
try:
from nanobot.channels.matrix import MatrixChannel
self.channels["matrix"] = MatrixChannel(
self.config.channels.matrix,
self.bus,
)
logger.info("Matrix channel enabled")
except ImportError as e:
logger.warning("Matrix channel not available: {}", e)
async def _start_channel(self, name: str, channel: BaseChannel) -> None:
"""Start a channel and log any exceptions."""