删除@ 之后的总结指令, 简化为#总结指令
This commit is contained in:
@@ -95,7 +95,7 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
return True, None
|
return True, None
|
||||||
# 权限判断
|
# 权限判断
|
||||||
gbm: GroupBotManager = message.get("gbm")
|
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
|
return True, None
|
||||||
# 从消息历史中获取群聊记录
|
# 从消息历史中获取群聊记录
|
||||||
all_contacts: dict = message.get("all_contacts")
|
all_contacts: dict = message.get("all_contacts")
|
||||||
|
|||||||
18
robot.py
18
robot.py
@@ -31,7 +31,6 @@ from group_auto.group_member_change import GroupMemberChange
|
|||||||
from group_video_man.bot_video_man import BotVideoMan
|
from group_video_man.bot_video_man import BotVideoMan
|
||||||
from message_sign.main import SignInSystem
|
from message_sign.main import SignInSystem
|
||||||
from message_storage.message_to_db import MessageStorage
|
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.event_system import EventType, EventSystem
|
||||||
from plugin_common.message_plugin_interface import MessagePluginInterface
|
from plugin_common.message_plugin_interface import MessagePluginInterface
|
||||||
from plugin_common.plugin_interface import PluginStatus
|
from plugin_common.plugin_interface import PluginStatus
|
||||||
@@ -226,9 +225,6 @@ class Robot(Job):
|
|||||||
elif q in ["nbc", "cnn", "abc", "fox", "bbc"]:
|
elif q in ["nbc", "cnn", "abc", "fox", "bbc"]:
|
||||||
self.news_en_report(q, (msg.roomid if msg.from_group() else msg.sender))
|
self.news_en_report(q, (msg.roomid if msg.from_group() else msg.sender))
|
||||||
return True
|
return True
|
||||||
elif q == '#总结':
|
|
||||||
self.message_summary_robot((msg.roomid if msg.from_group() else msg.sender))
|
|
||||||
return True
|
|
||||||
# 如果正则匹配到时加群指令,则从库中提取第一个群ID
|
# 如果正则匹配到时加群指令,则从库中提取第一个群ID
|
||||||
elif match:
|
elif match:
|
||||||
try:
|
try:
|
||||||
@@ -603,20 +599,6 @@ class Robot(Job):
|
|||||||
self.send_text_msg(output, r)
|
self.send_text_msg(output, r)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.LOG.error(f"SendRanking error:{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="每天发一个游戏任务")
|
@scheduled_job(cron="0 0 18 * * *", name="每天发一个游戏任务")
|
||||||
def game_auto_tasks(self):
|
def game_auto_tasks(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user