优化群总结问题。
This commit is contained in:
@@ -325,9 +325,6 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
self.LOG.info(f"找到 {len(enabled_groups)} 个开启定时总结的群聊")
|
self.LOG.info(f"找到 {len(enabled_groups)} 个开启定时总结的群聊")
|
||||||
|
|
||||||
# 获取所有联系人
|
|
||||||
all_contacts = ContactManager.get_instance().get_all_contacts()
|
|
||||||
|
|
||||||
# 为每个群生成总结
|
# 为每个群生成总结
|
||||||
for group_id in enabled_groups:
|
for group_id in enabled_groups:
|
||||||
try:
|
try:
|
||||||
@@ -345,14 +342,17 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
self.LOG.info(f"群 {group_id} 昨天有 {message_count} 条消息,开始获取内容")
|
self.LOG.info(f"群 {group_id} 昨天有 {message_count} 条消息,开始获取内容")
|
||||||
|
|
||||||
|
# 获取群成员信息
|
||||||
|
group_members = ContactManager.get_instance().get_group_members(group_id)
|
||||||
|
|
||||||
# 获取群名
|
# 获取群名
|
||||||
group_name = all_contacts.get(group_id, group_id)
|
group_name = ContactManager.get_instance().get_nickname(group_id)
|
||||||
group_name = self._sanitize_group_name(group_name)
|
group_name = self._sanitize_group_name(group_name)
|
||||||
|
|
||||||
# 获取昨天的聊天记录
|
# 获取昨天的聊天记录
|
||||||
chat_content = self.message_storage.get_messages_by_date_range(
|
chat_content = self.message_storage.get_messages_by_date_range(
|
||||||
group_id,
|
group_id,
|
||||||
all_contacts,
|
group_members,
|
||||||
yesterday_start,
|
yesterday_start,
|
||||||
yesterday_end
|
yesterday_end
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user