koishi icon indicating copy to clipboard operation
koishi copied to clipboard

Feature: 应令 true 成为指令配置中 checkArgCount 的缺省值。

Open BH4HPA opened this issue 2 years ago • 0 comments

Describe the problem related to the feature request

根据文档,定义的指令可以选用带有用尖括号包裹的必选参数,但 koishi 默认并不会对必选参数是否为空进行检测,这并不好。 翻阅文档,这正是因为指令配置中 checkArgCount 的缺省值为 false 造成的。 窃以为,可选参数才是进阶编程的操作,koishi 应当默认对必选的空参进行强检测,减少开发者的代码量。

Describe the solution you'd like

如题,应令 true 成为指令配置中 checkArgCount 的缺省值。

Describe alternatives you've considered

其他方法均需增加开发者的代码量,如对 checkArgCount 进行赋值,对空参数进行检测等..

Additional context

null

BH4HPA avatar Jul 27 '22 13:07 BH4HPA