koishi icon indicating copy to clipboard operation
koishi copied to clipboard

Bug: 指令的权限判断应当优先于指令解析的反馈

Open Hieuzest opened this issue 8 months ago • 1 comments

Describe the bug

例如有指令

ctx.command('foo', { authority: 3 }).option('ver', '-v <ver:number>')

当权限不足时,foo权限不足,而foo -v abcd则会报 选项ver输入无效

是否应该将部分逻辑移至on('attach') ? 或者延后parse reject的时机

ref: koishijs/koishi-plugin-switch#3

Steps to reproduce

/

Expected behavior

二者均应报权限不足

Screenshots

No response

Versions

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

Additional context

No response

Hieuzest avatar Jun 16 '24 09:06 Hieuzest