-
-
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
fix #764 #765
fix #764 #765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前的 Command.Config 不用于核验,你需要同时修改 Command.defaultConfig。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, you should update the unit tests as well. The changes introduced some failing tests:
- packages/core/tests/command.spec.ts
- packages/core/tests/runtime.spec.ts
重定向至获取指令帮助这里的代码应该没问题 koishi/packages/core/src/command/runtime.ts Lines 70 to 74 in f8680d9
koishi/packages/core/src/command/validate.ts Lines 47 to 64 in f8680d9
checkArgCount 的实现也是通过注册 command/before-execute 事件来实现的,但注册的好像更晚
koishi/packages/core/src/command/index.ts Lines 49 to 53 in f8680d9
|
Codecov Report
@@ Coverage Diff @@
## master #765 +/- ##
=======================================
Coverage 94.72% 94.72%
=======================================
Files 57 57
Lines 6142 6142
Branches 1229 1229
=======================================
Hits 5818 5818
Misses 324 324 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest: change the title to describe "what is changing in this PR, not just fix John Doe", for example, "check count arguments as default"
@@ -45,9 +45,9 @@ before(async () => { | |||
|
|||
describe('Admin Commands', () => { | |||
it('user/authorize', async () => { | |||
await client1.shouldReply('authorize', '请指定目标用户。') | |||
// await client1.shouldReply('authorize', '请指定目标用户。') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it commented
plugins/a11y/sudo/src/index.ts
Outdated
if (!message) return session.text('.expect-command') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to delete these lines? I think it would be better to show this message instead of the default one that didn't explicitly notify which argument it lacks.
Instead, what about to register this command with checkArgCount: false
?
Also, others commands everywhere that has the same problem as well.
fix #764