Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

[Bug?]: 私聊无法获取引用的消息ID? #855

@Qfxaile

Description

@Qfxaile

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述内容
  • 我已经使用 最新构建 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(其它疑问请考虑加入TG群询问或在discussions中提问)

Lagrange项目

OneBot

所使用/依赖的Lagrange项目对应的commit

569e33f

运行环境

Linux

运行架构

x64

连接方式

反向 WebSocket

重现步骤

Image
私聊:
打印event.reply的值显示为None
Image

群聊:
Image

期望的结果是什么?

期望私聊也能获取event.reply.message_id

实际的结果是什么?

实际结果就是无法获取到event.reply,打印event.reply显示的是None

简单的复现代码/链接(可选)

from nonebot import on_command, on_message
from nonebot.adapters.onebot.v11 import Bot, MessageEvent

cmd = on_command("测试", block=True, priority=1)
cmd2 = on_message(block=True, priority=1)


@cmd.handle()
async def handle_test_command():
    msg = await cmd.send("测试命令已触发!")
    await cmd.finish(f"上一条消息ID: {msg['message_id']}")


@cmd2.handle()
async def handle_id_command(bot: Bot, event: MessageEvent):
    if event.get_message().extract_plain_text() == "获取ID" and event.reply:
        msg_id = event.reply.message_id
        await cmd2.finish(f"回复的消息ID: {msg_id}")

Trace 级别日志记录(可选)

补充说明(可选)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug?Maybe it's a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions