koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.53k stars 246 forks source link

Bug: help 指令在遇到 .platform 或其他情况下回复错误 #1384

Open XxLittleCxX opened 8 months ago

XxLittleCxX commented 8 months ago

Describe the bug

如题

Steps to reproduce

两个插件如下

export function apply(ctx: Context) {
  // write your plugin here
  ctx.command('dev.bar')
  ctx.command('dev.baz')
}
export function apply(ctx: Context) {
  // write your plugin here
  ctx.platform('another', 'another2').command('dev.potato')
}

加载顺序A(修改插件在koishi.yml 内的顺序): image image 工作正常,插件配置页面分别如下: image image

此时交换两个插件顺序,不回复了 image image image

Expected behavior

正常显示帮助信息

Screenshots

No response

Versions

Additional context

No response

Hieuzest commented 2 months ago

看起来这是完全预期的,你应当手动定义 ctx.command('dev') 以明确其作用域