fix: genshin tool fix

This commit is contained in:
ikechan8370 2023-06-26 13:47:35 +08:00
parent 8bc5829777
commit c99af43571
2 changed files with 8 additions and 3 deletions

View file

@ -2066,7 +2066,12 @@ export class chatgpt extends plugin {
args.groupId = e.group_id + '' || e.sender.user_id + ''
}
if (!args.qq) {
args.qq = e.sender.user_id
args.qq = e.sender.user_id + ''
}
try {
parseInt(args.qq)
} catch (err) {
args.qq = e.sender.user_id + ''
}
let functionResult = await fullFuncMap[name].exec(Object.assign({ isAdmin, sender }, args), e)
logger.mark(`function ${name} execution result: ${functionResult}`)

View file

@ -22,7 +22,7 @@ export class QueryGenshinTool extends AbstractTool {
}
func = async function (opts, e) {
let { qq, uid, character = '' } = opts
let { qq, uid = '', character = '' } = opts
if (e.at === Bot.uin) {
e.at = null
}
@ -32,7 +32,7 @@ export class QueryGenshinTool extends AbstractTool {
let ProfileDetail = (await import('../../../miao-plugin/apps/profile/ProfileDetail.js')).default
// e.msg = `#${character}面板${uid}`
e.original_msg = `#${character}面板${uid}`
e.user_id = qq
e.user_id = parseInt(qq)
e.isSr = false
await ProfileDetail.detail(e)
return 'the character panel of genshin impact has been sent to group. you don\'t need text version'