From c2b9e7d535896edc543006d30d23f1b0958c067c Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 19 Mar 2025 16:05:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4@=20=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E6=80=BB=E7=BB=93=E6=8C=87=E4=BB=A4=EF=BC=8C=20?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=B8=BA#=E6=80=BB=E7=BB=93=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/message_summary/main.py | 2 +- robot.py | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/plugins/message_summary/main.py b/plugins/message_summary/main.py index 9f4e314..fef3aa8 100644 --- a/plugins/message_summary/main.py +++ b/plugins/message_summary/main.py @@ -95,7 +95,7 @@ class MessageSummaryPlugin(MessagePluginInterface): return True, None # 权限判断 gbm: GroupBotManager = message.get("gbm") - if gbm and gbm.get_group_permission(group_id, Feature.AI_CAPABILITY) == PermissionStatus.DISABLED: + if gbm and gbm.get_group_permission(group_id, Feature.SUMMARY_CAPABILITY) == PermissionStatus.DISABLED: return True, None # 从消息历史中获取群聊记录 all_contacts: dict = message.get("all_contacts") diff --git a/robot.py b/robot.py index 33b3094..db1c433 100644 --- a/robot.py +++ b/robot.py @@ -31,7 +31,6 @@ from group_auto.group_member_change import GroupMemberChange from group_video_man.bot_video_man import BotVideoMan from message_sign.main import SignInSystem from message_storage.message_to_db import MessageStorage -from message_summary.message_summary_dify import message_summary_dify from plugin_common.event_system import EventType, EventSystem from plugin_common.message_plugin_interface import MessagePluginInterface from plugin_common.plugin_interface import PluginStatus @@ -226,9 +225,6 @@ class Robot(Job): elif q in ["nbc", "cnn", "abc", "fox", "bbc"]: self.news_en_report(q, (msg.roomid if msg.from_group() else msg.sender)) return True - elif q == '#总结': - self.message_summary_robot((msg.roomid if msg.from_group() else msg.sender)) - return True # 如果正则匹配到时加群指令,则从库中提取第一个群ID elif match: try: @@ -603,20 +599,6 @@ class Robot(Job): self.send_text_msg(output, r) except Exception as e: self.LOG.error(f"SendRanking error:{e}") - - def message_summary_robot(self, sender: str = None): - try: - if self.gbm.get_group_permission(sender, Feature.SUMMARY_CAPABILITY) == PermissionStatus.ENABLED: - self.LOG.info(f"群: {sender} 消息总结开始执行!") - content = self.message_storage.get_messages(sender, self.allContacts) - summary, spath = message_summary_dify(content, self.allContacts.get(sender, sender)) - # self.send_text_msg(summary, sender) - self.wcf.send_file(spath, sender) - else: - self.send_text_msg("群发言总结功能未开启", sender) - except Exception as e: - self.LOG.error(f"message_summary_robot error:{e}") - # 设置定时任务 @scheduled_job(cron="0 0 18 * * *", name="每天发一个游戏任务") def game_auto_tasks(self):