mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
feat: add a tool
This commit is contained in:
parent
87182f1a1f
commit
ced2b4eeb6
2 changed files with 41 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ import { ImageCaptionTool } from '../utils/tools/ImageCaptionTool.js'
|
|||
import { TTSTool } from '../utils/tools/TTSTool.js'
|
||||
import { ProcessPictureTool } from '../utils/tools/ProcessPictureTool.js'
|
||||
import { APTool } from '../utils/tools/APTool.js'
|
||||
import {QueryGenshinTool} from "../utils/tools/QueryGenshinTool.js";
|
||||
try {
|
||||
await import('emoji-strip')
|
||||
} catch (err) {
|
||||
|
|
@ -1985,6 +1986,7 @@ export class chatgpt extends plugin {
|
|||
// new SendDiceTool(),
|
||||
new EditCardTool(),
|
||||
new QueryStarRailTool(),
|
||||
new QueryGenshinTool(),
|
||||
new WebsiteTool(),
|
||||
new JinyanTool(),
|
||||
new KickOutTool(),
|
||||
|
|
|
|||
39
utils/tools/QueryGenshinTool.js
Normal file
39
utils/tools/QueryGenshinTool.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { AbstractTool } from './AbstractTool.js'
|
||||
|
||||
export class QueryGenshinTool extends AbstractTool {
|
||||
name = 'queryGenshin'
|
||||
|
||||
parameters = {
|
||||
properties: {
|
||||
qq: {
|
||||
type: 'string',
|
||||
description: '要查询的用户的qq号,将使用该qq号绑定的uid进行查询'
|
||||
},
|
||||
uid: {
|
||||
type: 'string',
|
||||
description: '游戏的uid,如果用户提供了则传入并优先使用'
|
||||
}
|
||||
},
|
||||
required: ['qq', 'groupId']
|
||||
}
|
||||
|
||||
func = async function (opts, e) {
|
||||
let { qq, uid } = opts
|
||||
if (e.at === Bot.uin) {
|
||||
e.at = null
|
||||
}
|
||||
e.atBot = false
|
||||
try {
|
||||
let ProfileList = (await import('../../../miao-plugin/apps/profile/ProfileList.js')).default
|
||||
e.msg = '#面板' + uid
|
||||
e.user_id = qq
|
||||
e.isSr = false
|
||||
await ProfileList.render(e)
|
||||
return 'the player panel of genshin impact has been sent to group'
|
||||
} catch (err) {
|
||||
return `failed to query, error: ${err.toString()}`
|
||||
}
|
||||
}
|
||||
|
||||
description = 'Useful when you want to query player information of Genshin Impact(原神). '
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue