mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +00:00
fix: move send avatar into send picture tool
This commit is contained in:
parent
c375cba335
commit
4df97c7044
2 changed files with 12 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {AbstractTool} from "./AbstractTool.js";
|
||||
import { AbstractTool } from './AbstractTool.js'
|
||||
|
||||
export class SendAvatarTool extends AbstractTool {
|
||||
name = 'sendAvatar'
|
||||
|
|
@ -18,7 +18,7 @@ export class SendAvatarTool extends AbstractTool {
|
|||
}
|
||||
|
||||
func = async function (opts) {
|
||||
let {qq, groupId} = opts
|
||||
let { qq, groupId } = opts
|
||||
let groupList = await Bot.getGroupList()
|
||||
groupId = parseInt(groupId.trim())
|
||||
console.log('sendAvatar', groupId, qq)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ export class SendPictureTool extends AbstractTool {
|
|||
properties: {
|
||||
picture: {
|
||||
type: 'string',
|
||||
description: 'the url of the pictures, split with space if more than one '
|
||||
description: 'the url of the pictures, split with space if more than one.'
|
||||
},
|
||||
qq: {
|
||||
type: 'string',
|
||||
description: 'if you want to send avatar of a user, input his qq number.'
|
||||
},
|
||||
groupId: {
|
||||
type: 'string',
|
||||
|
|
@ -18,7 +22,11 @@ export class SendPictureTool extends AbstractTool {
|
|||
}
|
||||
|
||||
func = async function (opt) {
|
||||
let { picture, groupId } = opt
|
||||
let { picture, groupId, qq } = opt
|
||||
if (qq) {
|
||||
let avatar = `https://q1.qlogo.cn/g?b=qq&s=0&nk=${qq}`
|
||||
picture += ' ' + avatar
|
||||
}
|
||||
let pictures = picture.trim().split(' ')
|
||||
pictures = pictures.map(img => segment.image(img))
|
||||
let groupList = await Bot.getGroupList()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue