Skip to content

Commit

Permalink
feat(common): support channel/assign -T
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 2, 2021
1 parent 05b4591 commit 40afea0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugin-common/src/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ export default function apply(ctx: Context, config: AdminConfig = {}) {

ctx.command('channel/assign [bot:user]', '受理者账号', { authority: 4 })
.channelFields(['assignee'])
.adminChannel(async ({ session, target }, value) => {
const assignee = value ? Argv.parsePid(value)[1] : session.selfId
.option('noTarget', '-T 移除受理者')
.adminChannel(async ({ session, options, target }, value) => {
const assignee = options.noTarget ? null : value ? Argv.parsePid(value)[1] : session.selfId
if (assignee === target.assignee) return template('admin.channel-unchanged')
await ctx.database.createChannel(session.platform, session.channelId, { assignee })
target._merge({ assignee })
Expand Down

0 comments on commit 40afea0

Please sign in to comment.