feat(chat): 增强回复功能,支持通过字符串指定并显示用户ID
为了让插件能更灵活地构造回复消息,而无需依赖完整的原始消息对象,本次提交引入了新的回复机制。 - `send_api` 新增 `reply_to` 参数,允许使用 `昵称(ID)` 格式的字符串直接指定回复目标。 - 统一更新了回复消息的显示格式,在回复引文中一并展示用户昵称和ID,避免因昵称重复造成混淆。
This commit is contained in:
@@ -590,7 +590,7 @@ class MessageProcessBase(Message):
|
||||
if self.reply and hasattr(self.reply, "processed_plain_text"):
|
||||
# print(f"self.reply.processed_plain_text: {self.reply.processed_plain_text}")
|
||||
# print(f"reply: {self.reply}")
|
||||
return f"[回复<{self.reply.message_info.user_info.user_nickname}> 的消息:{self.reply.processed_plain_text}]" # type: ignore
|
||||
return f"[回复<{self.reply.message_info.user_info.user_nickname}({self.reply.message_info.user_info.user_id})> 的消息:{self.reply.processed_plain_text}]" # type: ignore
|
||||
return None
|
||||
else:
|
||||
return f"[{seg.type}:{seg.data!s}]"
|
||||
|
||||
Reference in New Issue
Block a user