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: kook上接收到的部分字符有误 #1050

Closed
9cats opened this issue Mar 30, 2023 · 4 comments
Closed

Bug: kook上接收到的部分字符有误 #1050

9cats opened this issue Mar 30, 2023 · 4 comments

Comments

@9cats
Copy link

9cats commented Mar 30, 2023

Describe the bug

在kook上,输入以下三个字符: [ ] 还有 `,机器人在处理信息时分别变为了 \\[ \\] 和 \\`

Steps to reproduce

1.添加以下测试代码

ctx.command("echoargs").action((_, ...args) => {
  console.log(args)
  return args
})

2.在kook上发送测试消息

echoargs [ ] `

3.在终端得到以下内容

[ '\\[', '\\]', '\\`' ]

Expected behavior

在终端得到的内容应该如下

[ '[', ']', '`' ]

Screenshots

image
image

Versions

  • OS: Windows 11
  • Platform: KOOK
  • Node version: 16.19.0
  • Koishi version: 4.12.2
  • @koishijs/plugin-adapter-kook version: 3.6.4

Additional context

No response

@9cats 9cats added the bug BUG label Mar 30, 2023
@shigma
Copy link
Member

shigma commented Mar 31, 2023

这是因为 kook 默认将用户输入理解成 markdown,后续会考虑引入 markdown 解析库进行处理。

@shigma
Copy link
Member

shigma commented Nov 6, 2023

已修复。

@maxoyed
Copy link

maxoyed commented Nov 10, 2023

已修复。

直接把content里面的markdown字符转义处理,会导致发送消息的时候 kmarkdown 几乎所有语法都被转义,从而失效了

@shigma
Copy link
Member

shigma commented Nov 10, 2023

直接把content里面的markdown字符转义处理,会导致发送消息的时候 kmarkdown 几乎所有语法都被转义,从而失效了

无关问题请单独提交 issue。根据 Satori 的标准,从来没有说过文本就是 kmarkdown,要发送富文本内容应当使用消息元素。

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

No branches or pull requests

3 participants