mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
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(原神). '
|
||
}
|