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

Bug: Command tokenizer错误地将无空格分隔的混合消息内容视为单一token #1427

Open
Hieuzest opened this issue Jul 16, 2024 · 1 comment
Labels
bug BUG

Comments

@Hieuzest
Copy link

Hieuzest commented Jul 16, 2024

Describe the bug

形如 xxx<img .../> 的消息可以被satori正确地拆分为 text + img
而在command('foo <a:string> <b:img>')中,这会被视为单一token被赋给第一个参数,导致处理错误

Steps to reproduce

/

Expected behavior

/

Screenshots

No response

Versions

  • OS:
  • Platform:
  • Node version:
  • Koishi version:

Additional context

No response

@Hieuzest Hieuzest added the bug BUG label Jul 16, 2024
@shigma
Copy link
Member

shigma commented Jul 18, 2024

这个问题我倾向于应该在 adapter 侧解决而非 command parser 内。

例如 foo<b>bar</b>,这种情况下可能不应该分词。

对于本 issue 涉及的真实场景,让 adapter 自动添加空格恐怕更加合理。

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

No branches or pull requests

2 participants