1.添加手动添加群组的能力
2.添加异步入库的能力
This commit is contained in:
@@ -62,7 +62,8 @@ class MessageStorage:
|
|||||||
return {
|
return {
|
||||||
'success': result,
|
'success': result,
|
||||||
'roomid': msg.roomid,
|
'roomid': msg.roomid,
|
||||||
'sender': msg.sender
|
'sender': msg.sender,
|
||||||
|
'content': msg.content # 添加消息内容
|
||||||
}
|
}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"存档消息出错: {e}")
|
logger.error(f"存档消息出错: {e}")
|
||||||
@@ -70,6 +71,7 @@ class MessageStorage:
|
|||||||
'success': False,
|
'success': False,
|
||||||
'roomid': msg.roomid,
|
'roomid': msg.roomid,
|
||||||
'sender': msg.sender,
|
'sender': msg.sender,
|
||||||
|
'content': msg.content, # 添加消息内容
|
||||||
'error': str(e)
|
'error': str(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +80,8 @@ class MessageStorage:
|
|||||||
try:
|
try:
|
||||||
result = future.result()
|
result = future.result()
|
||||||
if result['success']:
|
if result['success']:
|
||||||
logger.info(f"消息存档成功: {result['roomid']}:{result['sender']}")
|
# 修改日志输出,包含消息内容
|
||||||
|
logger.info(f"消息存档成功: {result['roomid']}:{result['sender']}: {result['content']}")
|
||||||
else:
|
else:
|
||||||
error_msg = result.get('error', '未知错误')
|
error_msg = result.get('error', '未知错误')
|
||||||
logger.error(f"消息存档失败: {result['roomid']}:{result['sender']} - {error_msg}")
|
logger.error(f"消息存档失败: {result['roomid']}:{result['sender']} - {error_msg}")
|
||||||
|
|||||||
Reference in New Issue
Block a user