mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
feat: 初步支持function call(WIP)
This commit is contained in:
parent
4a4dceec18
commit
97b3acbf3b
24 changed files with 13607 additions and 841 deletions
31
utils/tools/KickOutTool.js
Normal file
31
utils/tools/KickOutTool.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import {AbstractTool} from "./AbstractTool.js";
|
||||
|
||||
export class KickOutTool extends AbstractTool {
|
||||
name = 'kickOut'
|
||||
|
||||
parameters = {
|
||||
properties: {
|
||||
qq: {
|
||||
type: 'string',
|
||||
description: '你想踢出的那个人的qq号'
|
||||
},
|
||||
groupId: {
|
||||
type: 'string',
|
||||
description: '群号'
|
||||
}
|
||||
},
|
||||
required: ['qq', 'groupId']
|
||||
}
|
||||
|
||||
func = async function (opts) {
|
||||
let { qq, groupId } = opts
|
||||
groupId = parseInt(groupId.trim())
|
||||
qq = parseInt(qq.trim())
|
||||
console.log('kickout', groupId, qq)
|
||||
let group = await Bot.pickGroup(groupId)
|
||||
await group.kickMember(qq)
|
||||
return `the user ${qq} has been kicked out from group ${groupId}`
|
||||
}
|
||||
|
||||
description = 'Useful when you want to kick someone out of the group. The input to this tool should be the group number, the qq number of the one who should be kicked out, these two number should be concated with a space. '
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue