Skip to content

Commit

Permalink
fix: 优化一些tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Jun 26, 2023
1 parent 8257779 commit 328849b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
6 changes: 3 additions & 3 deletions utils/tools/APTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
}
Expand Down
21 changes: 15 additions & 6 deletions utils/tools/QueryGenshinTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`
}
Expand Down
1 change: 1 addition & 0 deletions utils/tools/QueryStarRailTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class QueryStarRailTool extends AbstractTool {
return '用户没有绑定uid,无法查询。可以让用户主动提供uid进行查询'
}
} catch (e) {
// todo support miao-plugin and sruid
return '未安装StarRail-Plugin,无法查询'
}
}
Expand Down

0 comments on commit 328849b

Please sign in to comment.