Skip to content

以 node-onebot 为后端无法正确设置 ctx['to_me'] #272

Closed
@yahvk-cuna

Description

@yahvk-cuna

问题描述
在遇到非标准的 at CQ 码时无法正确设置 ctx['to_me']

node-onebot 接受到的 at CQ 码中含有 text 字段,此时即使 @ 了机器人 ctx['to_me'] 也为 False

复现方法
使用 node-onebot 接受 @ 机器人的消息,读取 ctx['to_me']

期望的行为
ctx['to_me'] 设置为 True

日志信息
请附上 NoneBot 和 OneBot(CQHTTP)实现的运行日志(可截图或直接贴文本)。

8月 12 11:11:51 archlinux python[579338]: [2021-08-12 11:11:51,291 nonebot] INFO: Message MOupdCxsAPEAAAmeMsU2gGEUkXYB is handled as natural language
8月 12 11:11:55 archlinux python[579338]: [2021-08-12 11:11:55,872 nonebot] INFO: Self: 1512228781, Message MOupdCxsAPEAAAmgrVYGOWEUkXsB from 745275633@[群:820750708]: '[CQ:at,qq=1512228781,text=@休瓦尔札] .r'
8月 12 11:11:56 archlinux python[579338]: False // 这行为 ctx['to_me'] 的值

相关代码

@processMessage.args_parser
async def _(session: CommandSession):
    print(session.ctx['to_me'])

运行环境

  • 操作系统:Archlinux
  • OneBot(CQHTTP)实现及版本:node-onebot 1.3.0
  • NoneBot 版本:1.8.3
  • aiocqhttp 版本:1.4.0
  • Python 版本:3.9.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions