群总结,加入了前置提醒,防止用户焦虑
This commit is contained in:
@@ -51,7 +51,6 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
self._api_key = api_config.get("api_key", "app-McGLzBhBjeBCSEi7n83MtuTo")
|
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._api_url = api_config.get("api_url", "http://192.168.2.240/v1/chat-messages")
|
||||||
self.message_storage = MessageStorage()
|
self.message_storage = MessageStorage()
|
||||||
|
|
||||||
self.LOG.info(f"初始化 {self.name} 插件成功")
|
self.LOG.info(f"初始化 {self.name} 插件成功")
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -85,12 +84,11 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
command = content[len(self.command_prefix):].split()[0]
|
command = content[len(self.command_prefix):].split()[0]
|
||||||
if command not in self.commands:
|
if command not in self.commands:
|
||||||
return False, None
|
return False, None
|
||||||
|
wcf = message.get("wcf")
|
||||||
# 获取需要总结的内容
|
# 获取需要总结的内容
|
||||||
group_id = message.get("roomid")
|
group_id = message.get("roomid")
|
||||||
if not group_id:
|
if not group_id:
|
||||||
# 直接发送消息
|
# 直接发送消息
|
||||||
wcf = message.get("wcf")
|
|
||||||
if wcf:
|
if wcf:
|
||||||
wcf.send_text("只支持群聊消息总结", message.get("sender"))
|
wcf.send_text("只支持群聊消息总结", message.get("sender"))
|
||||||
return True, None
|
return True, None
|
||||||
@@ -108,7 +106,8 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
# 获取群名并处理
|
# 获取群名并处理
|
||||||
group_name = all_contacts.get(group_id, group_id)
|
group_name = all_contacts.get(group_id, group_id)
|
||||||
group_name = self._sanitize_group_name(group_name)
|
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)
|
summary, image_path = self._generate_summary(chat_content, group_name)
|
||||||
|
|
||||||
|
|||||||
1329
产品需求说明书.md
1329
产品需求说明书.md
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user