From 24502ed18c7ee9390eac570e3a9db66a2f73320b Mon Sep 17 00:00:00 2001 From: liuwei Date: Fri, 28 Feb 2025 09:54:44 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=8A=A0=E5=85=A58-=E5=90=AF?= =?UTF-8?q?=E7=94=A8=20=E5=9B=BE=E6=9D=A5=E5=8A=9F=E8=83=BD=E3=80=82?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=AE=A9=E5=85=B6=E4=BB=96=E7=BE=A4=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E7=9C=8B=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 30 ++++++++++++++++++------------ robot_cmd/robot_command.py | 1 + 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/robot.py b/robot.py index a30e70f..609448d 100644 --- a/robot.py +++ b/robot.py @@ -173,21 +173,27 @@ class Robot(Job): self.message_summary_robot((msg.roomid if msg.from_group() else msg.sender)) return True # 暂时只支持4K群要图 - elif q == "#图来" and msg.roomid == "45317011307@chatroom": - try: - file_path = get_xiuren_pic() - self.wcf.send_file(file_path, msg.roomid) - except Exception as e: - self.LOG.error(f"图来发图出错:{e}") + elif q == "#图来": + if self.gbm.get_group_permission(msg.roomid, Feature.PIC) == PermissionStatus.DISABLED: + return True + else: + try: + file_path = get_xiuren_pic() + self.wcf.send_file(file_path, msg.roomid) + except Exception as e: + self.LOG.error(f"图来发图出错:{e}") return True # 暂时只支持4K群要图 - elif q == "#黑丝" and msg.roomid == "45317011307@chatroom": - try: - file_path = get_xiuren_heisi_pic() - self.wcf.send_file(file_path, msg.roomid) - except Exception as e: - self.LOG.error(f"图来发图出错:{e}") + elif q == "#黑丝": + if self.gbm.get_group_permission(msg.roomid, Feature.PIC) == PermissionStatus.DISABLED: + return True + else: + try: + file_path = get_xiuren_heisi_pic() + self.wcf.send_file(file_path, msg.roomid) + except Exception as e: + self.LOG.error(f"黑丝发图出错:{e}") return True # 如果正则匹配到时加群指令,则从库中提取第一个群ID elif match: diff --git a/robot_cmd/robot_command.py b/robot_cmd/robot_command.py index 04291c8..3334635 100644 --- a/robot_cmd/robot_command.py +++ b/robot_cmd/robot_command.py @@ -29,6 +29,7 @@ class Feature(Enum): SUMMARY_CAPABILITY = 5, "群总结能力" PDF_CAPABILITY = 6, "sehuatang PDF能力" EPIC = 7, "EPIC自动播报" # 新增的功能 + PIC = 8, "图来能力" def __new__(cls, value, description): obj = object.__new__(cls)