fix: Matrix用户消息同步到网页端
- 新增 user_message action 回调 - handle_matrix_message 处理 user_message 通知 - 网页端 WebSocket 接收用户消息
This commit is contained in:
Binary file not shown.
@@ -224,6 +224,17 @@ class MatrixBot:
|
||||
}
|
||||
)
|
||||
|
||||
# 立即通知网页端有新用户消息(通过回调)
|
||||
if self.on_message_callback:
|
||||
await self.on_message_callback(
|
||||
action="user_message",
|
||||
conversation_id=conversation.conversation_id,
|
||||
user_message=message_text,
|
||||
room_id=room.room_id,
|
||||
message_id=user_msg.id,
|
||||
sender=sender
|
||||
)
|
||||
|
||||
# 发送"正在输入"状态
|
||||
try:
|
||||
await self.client.room_typing(room.room_id, typing_state=True)
|
||||
|
||||
Reference in New Issue
Block a user