测试seht

This commit is contained in:
liuwei
2025-05-15 14:32:06 +08:00
parent 5ce2c4dc67
commit 651c509111
2 changed files with 21 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ from plugin_common.message_plugin_interface import MessagePluginInterface
from plugin_common.plugin_interface import PluginStatus
from plugin_common.plugin_manager import PluginManager
from plugin_common.plugin_registry import PluginRegistry
from sehuatang.shehuatang import pdf_file_path
from utils.revoke.message_auto_revoke import MessageAutoRevoke
from utils.robot_cmd.robot_command import GroupBotManager, Feature, PermissionStatus
@@ -464,6 +465,17 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"send_group_txt_message:{feature.description} error{e}")
async def send_group_file_message(self, path: str, feature: Feature):
try:
receivers = self.gbm.get_group_list()
if not receivers:
return
for r in receivers:
if self.gbm.get_group_permission(r, feature) == PermissionStatus.ENABLED:
await self.ipad_bot.send_image_message(r,path)
except Exception as e:
self.LOG.error(f"send_group_file_message:{feature.description} error{e}")
async def process_plugin_message(self, msg) -> bool:
"""使用插件处理消息"""
# 获取所有消息处理插件
@@ -647,14 +659,14 @@ class Robot(Job):
except Exception as e:
self.LOG.error(f"write_to_db error{e}")
# def generate_sehuatang_pdf(self):
# try:
# self.LOG.info("开始生成PDF,generate_sehuatang_pdf")
# path = pdf_file_path()
# # 暂时只发4K群
# self.send_group_file_message(path, Feature.PDF_CAPABILITY)
# except Exception as e:
# self.LOG.error(f"generateSehuatangPdf error{e}")
def generate_sehuatang_pdf(self):
try:
self.LOG.info("开始生成PDF,generate_sehuatang_pdf")
path = pdf_file_path()
# 暂时只发4K群
self.send_group_file_message(path, Feature.PDF_CAPABILITY)
except Exception as e:
self.LOG.error(f"generateSehuatangPdf error{e}")
def xiu_ren_download_task(self):
try:
# 每天下载10组图然后发一个帖子PDF