群总结,加入了前置提醒,防止用户焦虑

This commit is contained in:
liuwei
2025-03-21 14:49:07 +08:00
parent 12e01c4e2a
commit d168597474
2 changed files with 520 additions and 816 deletions

View File

@@ -51,7 +51,6 @@ class MessageSummaryPlugin(MessagePluginInterface):
self._api_key = api_config.get("api_key", "app-McGLzBhBjeBCSEi7n83MtuTo")
self._api_url = api_config.get("api_url", "http://192.168.2.240/v1/chat-messages")
self.message_storage = MessageStorage()
self.LOG.info(f"初始化 {self.name} 插件成功")
return True
except Exception as e:
@@ -85,12 +84,11 @@ class MessageSummaryPlugin(MessagePluginInterface):
command = content[len(self.command_prefix):].split()[0]
if command not in self.commands:
return False, None
wcf = message.get("wcf")
# 获取需要总结的内容
group_id = message.get("roomid")
if not group_id:
# 直接发送消息
wcf = message.get("wcf")
if wcf:
wcf.send_text("只支持群聊消息总结", message.get("sender"))
return True, None
@@ -108,7 +106,8 @@ class MessageSummaryPlugin(MessagePluginInterface):
# 获取群名并处理
group_name = all_contacts.get(group_id, group_id)
group_name = self._sanitize_group_name(group_name)
if wcf:
wcf.send_text("⏳群消息总结中… 😊", group_id)
# 生成总结
summary, image_path = self._generate_summary(chat_content, group_name)

File diff suppressed because it is too large Load Diff