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)