From 9d7afb63f23befed823de68499adb0661bcf7c78 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 10 Mar 2025 15:02:41 +0800 Subject: [PATCH] =?UTF-8?q?feature=EF=BC=9A=E5=8A=A0=E7=BE=A4=E6=8F=90?= =?UTF-8?q?=E9=86=92=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- group_add/main.py | 7 ++++++- robot_cmd/robot_command.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/group_add/main.py b/group_add/main.py index 5a1bbe2..301b53e 100644 --- a/group_add/main.py +++ b/group_add/main.py @@ -6,7 +6,7 @@ import tomllib import redis from wcferry import Wcf, WxMsg -from robot_cmd.robot_command import GroupBotManager +from robot_cmd.robot_command import GroupBotManager, Feature, PermissionStatus class GroupAdd: @@ -28,6 +28,11 @@ class GroupAdd: def handle_message(self, message: WxMsg): if not self.enable: return + + # 如果触发了指令,但是没有权限,则返回权限不足 + if self.gbm.get_group_permission(message.roomid, Feature.GROUP_ADD) == PermissionStatus.DISABLED: + return + now_time = str(datetime.now().strftime("%Y-%m-%d %H:%M:%S")) nick_name = self.all_contacts.get(message.sender, message.sender) diff --git a/robot_cmd/robot_command.py b/robot_cmd/robot_command.py index 223d407..d6e958b 100644 --- a/robot_cmd/robot_command.py +++ b/robot_cmd/robot_command.py @@ -37,6 +37,7 @@ class Feature(Enum): BEAUTY_LEG = 13, "腿来能力 [美腿, 腿来]" VIDEO = 14, "视频点播功能 [黑丝视频, 黑丝, 来个黑丝,搞个黑丝]" VIDEO_MAN = 15, "视频肌肉男点播功能 [猛男, 肌肉, 帅哥]" + GROUP_ADD = 16, "加群提醒功能" def __new__(cls, value, description): obj = object.__new__(cls)