From b564f70c639560fa924d6743dcd3760a0ddac55a Mon Sep 17 00:00:00 2001 From: jxxghp Date: Tue, 5 Sep 2023 11:33:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=BE=AE=E4=BF=A1=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/command.py | 3 +-- app/modules/wechat/__init__.py | 11 ++++++----- app/modules/wechat/wechat.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/command.py b/app/command.py index 21212820..8a3ed1cb 100644 --- a/app/command.py +++ b/app/command.py @@ -109,13 +109,12 @@ class Command(metaclass=Singleton): "/downloading": { "func": DownloadChain(self._db).remote_downloading, "description": "正在下载", - "category": "下载", "data": {} }, "/transfer": { "func": TransferChain(self._db).process, "description": "下载文件整理", - "category": "下载", + "category": "管理", "data": {} }, "/redo": { diff --git a/app/modules/wechat/__init__.py b/app/modules/wechat/__init__.py index 15059322..4def27e4 100644 --- a/app/modules/wechat/__init__.py +++ b/app/modules/wechat/__init__.py @@ -96,11 +96,12 @@ class WechatModule(_ModuleBase): # 解析消息内容 if msg_type == "event" and event == "click": # 校验用户有权限执行交互命令 - wechat_admins = settings.WECHAT_ADMINS.split(',') - if wechat_admins and not any( - user_id == admin_user for admin_user in wechat_admins): - self.wechat.send_msg(title="用户无权限执行菜单命令", userid=user_id) - return None + if settings.WECHAT_ADMINS: + wechat_admins = settings.WECHAT_ADMINS.split(',') + if wechat_admins and not any( + user_id == admin_user for admin_user in wechat_admins): + self.wechat.send_msg(title="用户无权限执行菜单命令", userid=user_id) + return None # 根据Event执行命令 content = event logger.info(f"收到微信事件:userid={user_id}, event={content}") diff --git a/app/modules/wechat/wechat.py b/app/modules/wechat/wechat.py index 38905e58..5d7751f4 100644 --- a/app/modules/wechat/wechat.py +++ b/app/modules/wechat/wechat.py @@ -286,7 +286,7 @@ class WeChat(metaclass=Singleton): "data": {} } } - 注册报文格式,子菜单最多只有5条: + 注册报文格式,一级菜单只有最多3条,子菜单最多只有5条: { "button":[ {