Skip to content

Commit

Permalink
fix(plugin-common): help user fields
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jan 14, 2020
1 parent 1f6689b commit c7650cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/koishi-core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export class App extends Context {
// attach group data
const groupFields = new Set<GroupField>(['flag', 'assignee'])
this.receiver.emit('before-group', groupFields, parsedArgv || { meta })
const group = await this.database.observeGroup(meta.groupId, 0, Array.from(groupFields))
const group = await this.database.observeGroup(meta.groupId, Array.from(groupFields))
Object.defineProperty(meta, '$group', { value: group, writable: true })

// ignore some group calls
Expand All @@ -322,7 +322,7 @@ export class App extends Context {
// attach user data
const userFields = new Set<UserField>(['name', 'flag'])
this.receiver.emit('before-user', userFields, parsedArgv || { meta })
const user = await this.database.observeUser(meta.userId, 0, Array.from(userFields))
const user = await this.database.observeUser(meta.userId, Array.from(userFields))
Object.defineProperty(meta, '$user', { value: user, writable: true })

// ignore some user calls
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-common/src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Context, Command, UserData, CommandConfig, MessageMeta } from 'koishi-c

export default function apply (ctx: Context, options: CommandConfig) {
ctx.command('help [command]', '显示帮助信息', { authority: 0, ...options })
.userFields(['authority', 'usage'])
.shortcut('帮助', { fuzzy: true })
.shortcut('全局指令', { options: { shortcut: true } })
.option('-e, --expand', '展开指令列表')
Expand Down

0 comments on commit c7650cb

Please sign in to comment.