-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Feature: Telegram API Error BOT_COMMAND_INVALID 时 显示造成错误的指令 #1433
Comments
嗯这个问题我们本身也比较困扰。 理论上我们应该在注册 telegram 斜线指令的时候就过滤掉不合法的部分。但是似乎 telegram 并没有给出具体的信息?(discord 的话返回值会包含具体哪个指令因为什么原因炸了。) 如果有人定位了出现问题的指令,可以回复此 issue,我们会添加注册前检查的逻辑。 |
Telegram API doc 说只有 32 字符以内的纯英文字母、数字、下划线受支持,除此之外没有其他相关内容 是否可能将带 . 的复合指令或中文指令或其他类似的东西传进去了? 感觉可以先加个 debug 在控制台显示到底往 Telegram API 传了什么指令。 |
如果你愿意帮忙调试的话,可以按照这个流程查看:
+ logger:
+ levels:
+ telegram: 3 注意:不是写在 plugins 下面,而是与 plugins 同级放一个 logger。
|
以上是一些可能有用的信息 |
在我手动将它们的「斜杠指令」关闭后问题完全消失。 |
在测试过程中我还发现,当协议设置为「server」时,关闭插件疑似可能导致 webhook 不重置,造成机器人收不到消息,具体表现为发消息(即使是 /help)也无回复,日志无反应。不过这似乎应该另开一个 Issue。 |
Discord 中指令参数跟选项重名会报错,指令名含有中文似乎也不行。 |
Describe the problem related to the feature request
如果你的机器人有许多插件,那么接入 Telegram 时很可能会报如下错误:
这会导致斜杠指令无法使用且不与 Koishi 侧同步,若关闭斜杠指令则机器人不再响应 @ 它的消息。
Describe the solution you'd like
希望能在报错时显示哪个指令引发错误(如果 Telegram API 回传了此信息的话)
或者提供一个插件二分法等方式快速定位造成问题的插件(可能难以开发,不知道有没有别的方法)
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: