图来进行简单指令化
This commit is contained in:
35
robot.py
35
robot.py
@@ -47,6 +47,7 @@ from message_report.process_message import process_message
|
||||
from message_report.write_db import write_to_db, generate_and_send_ranking
|
||||
from message_summary.message_summary_4o import message_summary
|
||||
from sehuatang.shehuatang import pdf_file_path
|
||||
from xiuren.main import Xiuren
|
||||
from xiuren.meitu_dl import meitu_dowload_pic, meitu_dowload_pub_pic, meitu_dowload_heisi_pic
|
||||
from xiuren.random_pic import get_xiuren_pic, get_xiuren_heisi_pic
|
||||
from xiuren.xiuren_pdf import generate_pdf_from_images
|
||||
@@ -87,6 +88,8 @@ class Robot(Job):
|
||||
self.trade = PointTrade(wcf, self.gbm, self.db_pool)
|
||||
# 获取视频模块
|
||||
self.video = BotVideo(wcf, self.gbm)
|
||||
# 秀人模块
|
||||
self.xiuren = Xiuren(wcf, self.gbm)
|
||||
|
||||
if ChatType.is_in_chat_types(chat_type):
|
||||
if chat_type == ChatType.TIGER_BOT.value and TigerBot.value_check(self.config.TIGERBOT):
|
||||
@@ -214,25 +217,6 @@ class Robot(Job):
|
||||
self.message_summary_robot((msg.roomid if msg.from_group() else msg.sender))
|
||||
return True
|
||||
# 暂时只支持4K群要图
|
||||
elif q == "#图来":
|
||||
if self.gbm.get_group_permission(msg.roomid, Feature.PIC) == PermissionStatus.DISABLED:
|
||||
return True
|
||||
else:
|
||||
try:
|
||||
file_path = get_xiuren_pic()
|
||||
self.LOG.info(f"发送文件:{file_path}")
|
||||
self.wcf.send_file(file_path, msg.roomid)
|
||||
# 正则表达式匹配路径中的数字目录
|
||||
# match = re.search(r'\\(\d+)\\', file_path)
|
||||
# if match:
|
||||
# self.wcf.send_text(
|
||||
# f"目录:[{match.group(1)}]\n输入 删除 {match.group(1)} 进行丑图排除", msg.roomid)
|
||||
|
||||
except Exception as e:
|
||||
self.LOG.error(f"图来发图出错:{e}")
|
||||
return True
|
||||
|
||||
# 暂时只支持4K群要图
|
||||
elif q == "#黑丝":
|
||||
if self.gbm.get_group_permission(msg.roomid, Feature.PIC) == PermissionStatus.DISABLED:
|
||||
return True
|
||||
@@ -353,12 +337,18 @@ class Robot(Job):
|
||||
except Exception as e:
|
||||
self.LOG.error(f"point trade error: {e}")
|
||||
|
||||
# 加入积分赠与功能
|
||||
# 加入黑丝视频功能
|
||||
try:
|
||||
self.video.get_video(message=msg)
|
||||
except Exception as e:
|
||||
self.LOG.error(f"video get_video error: {e}")
|
||||
|
||||
# 加入秀人图来功能
|
||||
try:
|
||||
self.xiuren.handle_message(message=msg)
|
||||
except Exception as e:
|
||||
self.LOG.error(f"xiuren.handle_message error: {e}")
|
||||
|
||||
if msg.is_at(self.wxid): # 被@
|
||||
self.toAt(msg)
|
||||
return # 处理完群聊信息,后面就不需要处理了
|
||||
@@ -650,8 +640,3 @@ class Robot(Job):
|
||||
|
||||
except Exception as e:
|
||||
self.LOG.error(f"xiu_ren_pdf_send error:{e}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
heisi_path = generate_pdf_from_images("xiuren/heisi")
|
||||
print(heisi_path)
|
||||
|
||||
Reference in New Issue
Block a user