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))
|
self.message_summary_robot((msg.roomid if msg.from_group() else msg.sender))
|
||||||
return True
|
return True
|
||||||
# 暂时只支持4K群要图
|
# 暂时只支持4K群要图
|
||||||
elif q == "#图来" and msg.roomid == "45317011307@chatroom":
|
elif q == "#图来":
|
||||||
try:
|
if self.gbm.get_group_permission(msg.roomid, Feature.PIC) == PermissionStatus.DISABLED:
|
||||||
file_path = get_xiuren_pic()
|
return True
|
||||||
self.wcf.send_file(file_path, msg.roomid)
|
else:
|
||||||
except Exception as e:
|
try:
|
||||||
self.LOG.error(f"图来发图出错:{e}")
|
file_path = get_xiuren_pic()
|
||||||
|
self.wcf.send_file(file_path, msg.roomid)
|
||||||
|
except Exception as e:
|
||||||
|
self.LOG.error(f"图来发图出错:{e}")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# 暂时只支持4K群要图
|
# 暂时只支持4K群要图
|
||||||
elif q == "#黑丝" and msg.roomid == "45317011307@chatroom":
|
elif q == "#黑丝":
|
||||||
try:
|
if self.gbm.get_group_permission(msg.roomid, Feature.PIC) == PermissionStatus.DISABLED:
|
||||||
file_path = get_xiuren_heisi_pic()
|
return True
|
||||||
self.wcf.send_file(file_path, msg.roomid)
|
else:
|
||||||
except Exception as e:
|
try:
|
||||||
self.LOG.error(f"图来发图出错:{e}")
|
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
|
return True
|
||||||
# 如果正则匹配到时加群指令,则从库中提取第一个群ID
|
# 如果正则匹配到时加群指令,则从库中提取第一个群ID
|
||||||
elif match:
|
elif match:
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class Feature(Enum):
|
|||||||
SUMMARY_CAPABILITY = 5, "群总结能力"
|
SUMMARY_CAPABILITY = 5, "群总结能力"
|
||||||
PDF_CAPABILITY = 6, "sehuatang PDF能力"
|
PDF_CAPABILITY = 6, "sehuatang PDF能力"
|
||||||
EPIC = 7, "EPIC自动播报" # 新增的功能
|
EPIC = 7, "EPIC自动播报" # 新增的功能
|
||||||
|
PIC = 8, "图来能力"
|
||||||
|
|
||||||
def __new__(cls, value, description):
|
def __new__(cls, value, description):
|
||||||
obj = object.__new__(cls)
|
obj = object.__new__(cls)
|
||||||
|
|||||||
Reference in New Issue
Block a user