mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
Merge branch 'v2' of https://github.com/gaoao-3/chatgpt-plugin into v2
This commit is contained in:
commit
79ba315bae
1 changed files with 7 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ export class EditCardTool extends AbstractTool {
|
||||||
description = 'Useful when you want to edit someone\'s card in the group(群名片)'
|
description = 'Useful when you want to edit someone\'s card in the group(群名片)'
|
||||||
|
|
||||||
func = async function (opts, e) {
|
func = async function (opts, e) {
|
||||||
let { qq, card, groupId } = opts
|
let { qq, card, groupId, isAdmin } = opts
|
||||||
qq = isNaN(qq) || !qq ? e.sender.user_id : parseInt(qq.trim())
|
qq = isNaN(qq) || !qq ? e.sender.user_id : parseInt(qq.trim())
|
||||||
groupId = isNaN(groupId) || !groupId ? e.group_id : parseInt(groupId.trim())
|
groupId = isNaN(groupId) || !groupId ? e.group_id : parseInt(groupId.trim())
|
||||||
|
|
||||||
|
|
@ -41,7 +41,11 @@ export class EditCardTool extends AbstractTool {
|
||||||
logger.error('获取群信息失败,可能使用的底层协议不完善')
|
logger.error('获取群信息失败,可能使用的底层协议不完善')
|
||||||
}
|
}
|
||||||
logger.info('edit card: ', groupId, qq)
|
logger.info('edit card: ', groupId, qq)
|
||||||
await group.setCard(qq, card)
|
if (isAdmin) {
|
||||||
|
await group.setCard(qq, card)
|
||||||
|
} else {
|
||||||
|
return 'the user is not admin, he can\'t edit card of other people.'
|
||||||
|
}
|
||||||
return `the user ${qq}'s card has been changed into ${card}`
|
return `the user ${qq}'s card has been changed into ${card}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue