feature: 加入8-启用 图来功能。可以让其他群也能看图
This commit is contained in:
30
robot.py
30
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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user