feat(wechat): add WeChatBot class for intelligent bot integration and enhance WechatModule to support bot mode

- Introduced WeChatBot class for handling intelligent bot functionalities.
- Updated WechatModule to differentiate between traditional and bot modes using WECHAT_MODE configuration.
- Enhanced stop method in WechatModule to gracefully stop client instances.
- Added logic to skip traditional menu initialization for bot mode.
- Updated .gitignore to include .venv directory.
This commit is contained in:
EkkoG
2026-03-14 16:17:39 +08:00
parent 6cd071c84b
commit 510476c214
3 changed files with 531 additions and 3 deletions

View File

@@ -86,7 +86,10 @@ def wechat_verify(echostr: str, msg_signature: str, timestamp: Union[str, int],
if not client_configs:
return "未找到对应的消息配置"
client_config = next((config for config in client_configs if
config.type == "wechat" and config.enabled and (not source or config.name == source)), None)
config.type == "wechat"
and config.enabled
and config.config.get("WECHAT_MODE", "app") != "bot"
and (not source or config.name == source)), None)
if not client_config:
return "未找到对应的消息配置"
try: