Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法正确识别“回复”类型消息中的指令 #299

Open
Hyiker opened this issue Jun 30, 2022 · 2 comments
Open

无法正确识别“回复”类型消息中的指令 #299

Hyiker opened this issue Jun 30, 2022 · 2 comments

Comments

@Hyiker
Copy link

Hyiker commented Jun 30, 2022

问题描述
当消息类型为“回复消息”时,即消息本身为一条回复其他消息的消息时,on_command装饰器无法将其解析为一条指令

复现方法
回复消息的同时,at bot账号并且输入指令

期望的行为
当bot被at时,应该识别“回复消息”类型的指令

日志信息

[2022-06-30 21:33:37,087] INFO in init: received event: message.group.normal
[2022-06-30 21:33:37,089 nonebot] INFO: Self: xxxxx, Message -xxxxxfrom 961531608@[群:758194774]: '[CQ:reply,id=-xxxxx][CQ:at,qq=xxxxx] 整个活 [CQ:at,qq=xxxxx] '
[2022-06-30 21:33:37,089 nonebot] DEBUG: Parsing command: '[CQ:reply,id=-xxxxx][CQ:at,qq=xxxxx] 整个活 '
[2022-06-30 21:33:37,089 nonebot] DEBUG: Matched command start: (empty)
[2022-06-30 21:33:37,089 nonebot] DEBUG: Split command name: ('[CQ:reply,id=-xxxxx][CQ:at,qq=xxxxx]',)
[2022-06-30 21:33:37,089 nonebot] DEBUG: Command ('[CQ:reply,id=-xxxxx][CQ:at,qq=xxxxx]',) not found. Try to match aliases
[2022-06-30 21:33:37,089 nonebot] DEBUG: Alias ('[CQ:reply,id=-1499673145][CQ:at,qq=xxxxx]',) not found. Try to match patterns
[2022-06-30 21:33:37,089 nonebot] DEBUG: Not a known command, ignored

相关代码

@on_command('makeitaquote', aliases=('整个活', '整活'), only_to_me=True)
async def makeitaquote(session: CommandSession):
    await session.send('整个活')

运行环境

  • 操作系统:Windows 10 21H2
  • OneBot(CQHTTP)实现及版本:v1.0.0-rc3
  • NoneBot 版本:1.9.1
  • aiocqhttp 版本:
  • Python 版本:3.10.5
@cleoold
Copy link
Member

cleoold commented Jun 30, 2022 via email

@axty666
Copy link

axty666 commented Jul 16, 2022

考虑试试only_to_me=False?
参见一下这个

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants