fix: 优化一些tool

This commit is contained in:
ikechan8370 2023-06-26 13:25:00 +08:00
parent 8257779f5c
commit 328849b320
3 changed files with 19 additions and 9 deletions

View file

@ -7,10 +7,10 @@ export class APTool extends AbstractTool {
properties: {
prompt: {
type: 'string',
description: 'draw prompt of StableDiffusion, must be in English'
description: 'draw prompt of StableDiffusion, prefer to be in English. should be many keywords split by comma.'
}
},
required: ['prompt']
required: []
}
description = 'Useful when you want to draw picture'
@ -39,7 +39,7 @@ export class APTool extends AbstractTool {
try {
e.msg = '#绘图' + prompt
await ap.aiPainting(e)
return 'draw success!'
return 'draw success, picture has been sent.'
} catch (err) {
return 'draw failed due to unknown error'
}

View file

@ -28,12 +28,21 @@ export class QueryGenshinTool extends AbstractTool {
}
e.atBot = false
try {
let ProfileList = (await import('../../../miao-plugin/apps/profile/ProfileList.js')).default
e.msg = `#${character}面板${uid}`
e.user_id = qq
e.isSr = false
await ProfileList.render(e)
return 'the player panel of genshin impact has been sent to group'
if (character) {
let ProfileDetail = (await import('../../../miao-plugin/apps/profile/ProfileDetail.js')).default
e.msg = `#${character}面板${uid}`
e.user_id = qq
e.isSr = false
await ProfileDetail.detail(e)
return 'the character panel of genshin impact has been sent to group'
} else {
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()}`
}

View file

@ -36,6 +36,7 @@ export class QueryStarRailTool extends AbstractTool {
return '用户没有绑定uid无法查询。可以让用户主动提供uid进行查询'
}
} catch (e) {
// todo support miao-plugin and sruid
return '未安装StarRail-Plugin无法查询'
}
}