diff --git a/app/modules/feishu/__init__.py b/app/modules/feishu/__init__.py index 21f54562f..54d0d85d8 100644 --- a/app/modules/feishu/__init__.py +++ b/app/modules/feishu/__init__.py @@ -38,6 +38,13 @@ class FeishuModule(_MessageChannelModuleBase[Feishu]): def get_priority() -> int: return 2 + def _commands_enabled(self, config: Optional[dict]) -> bool: + """ + 飞书机器人无斜杠命令概念,lark_oapi Client 也不提供命令注册/删除 API, + 跳过命令注册,避免基类默认钩子调用不存在的 client.register_commands。 + """ + return False + def stop(self) -> None: """停止模块""" for client in self.get_instances().values(): diff --git a/app/modules/qqbot/__init__.py b/app/modules/qqbot/__init__.py index 2c16a1392..3d402b877 100644 --- a/app/modules/qqbot/__init__.py +++ b/app/modules/qqbot/__init__.py @@ -81,6 +81,13 @@ class QQBotModule(_MessageChannelModuleBase[QQBot]): def get_priority() -> int: return 10 + def _commands_enabled(self, config: Optional[dict]) -> bool: + """ + QQ 机器人客户端未提供命令注册/删除 API,跳过命令注册, + 避免基类默认钩子调用不存在的 client.register_commands。 + """ + return False + def stop(self) -> None: """停止模块""" for client in self.get_instances().values(): diff --git a/app/modules/wechatclawbot/__init__.py b/app/modules/wechatclawbot/__init__.py index adca12d74..f349b0406 100644 --- a/app/modules/wechatclawbot/__init__.py +++ b/app/modules/wechatclawbot/__init__.py @@ -61,6 +61,13 @@ class WechatClawBotModule(_MessageChannelModuleBase[WechatClawBot]): """获取模块优先级。""" return 2 + def _commands_enabled(self, config: Optional[dict]) -> bool: + """ + 微信爪爪机器人客户端未提供命令注册/删除 API,跳过命令注册, + 避免基类默认钩子调用不存在的 client.register_commands。 + """ + return False + def stop(self) -> None: """停止模块""" for client in self.get_instances().values():