Skip to content

Commit

Permalink
fix(core): set disable as command field, fix #155
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 18, 2021
1 parent dfdba08 commit 97d8732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/koishi-core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class App extends Context {
if (this.database) {
if (session.subtype === 'group') {
// attach group data
const channelFields = new Set<Channel.Field>(['flag', 'assignee', 'disable'])
const channelFields = new Set<Channel.Field>(['flag', 'assignee'])
this.emit('before-attach-channel', session, channelFields)
const channel = await session.observeChannel(channelFields)

Expand Down
2 changes: 2 additions & 0 deletions packages/koishi-core/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ export function getUsageName(command: Command) {

export type ValidationField = 'authority' | 'usage' | 'timers'

Command.channelFields(['disable'])

Command.userFields(({ tokens, command, options = {} }, fields) => {
if (!command) return
const { maxUsage, minInterval, authority } = command.config
Expand Down

0 comments on commit 97d8732

Please sign in to comment.