mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 修复
This commit is contained in:
parent
9838459446
commit
f0b717bed8
23 changed files with 799 additions and 48 deletions
|
|
@ -11,20 +11,20 @@ export class EditCardTool extends AbstractTool {
|
|||
},
|
||||
card: {
|
||||
type: 'string',
|
||||
description: '你想给他改的新名片'
|
||||
description: 'the new card'
|
||||
},
|
||||
groupId: {
|
||||
type: 'string',
|
||||
description: '群号'
|
||||
description: 'group number'
|
||||
}
|
||||
},
|
||||
required: ['card', 'groupId']
|
||||
}
|
||||
|
||||
description = '当你想要修改某个群员的群名片时有用。输入应该是群号、qq号和群名片,用空格隔开。'
|
||||
description = 'Useful when you want to edit someone\'s card in the group(群名片)'
|
||||
|
||||
func = async function (opts) {
|
||||
let {qq, card, groupId} = opts
|
||||
let { qq, card, groupId } = opts
|
||||
groupId = parseInt(groupId.trim())
|
||||
qq = parseInt(qq.trim())
|
||||
logger.info('edit card: ', groupId, qq)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export class HandleMessageMsgTool extends AbstractTool {
|
|||
},
|
||||
messageId: {
|
||||
type: 'string',
|
||||
description: 'which message, current one by default'
|
||||
description: 'which message to handle, current one by default'
|
||||
}
|
||||
},
|
||||
required: ['type']
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { AbstractTool } from './AbstractTool.js'
|
|||
import { getMasterQQ } from '../common.js'
|
||||
|
||||
export class QueryUserinfoTool extends AbstractTool {
|
||||
name = 'sendDice'
|
||||
name = 'queryUser'
|
||||
|
||||
parameters = {
|
||||
properties: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import {AbstractTool} from "./AbstractTool.js";
|
||||
|
||||
import { AbstractTool } from './AbstractTool.js'
|
||||
|
||||
export class SendDiceTool extends AbstractTool {
|
||||
name = 'sendDice'
|
||||
|
|
@ -19,7 +18,7 @@ export class SendDiceTool extends AbstractTool {
|
|||
}
|
||||
|
||||
func = async function (opts) {
|
||||
let {num, groupId} = opts
|
||||
let { num, groupId } = opts
|
||||
let groupList = await Bot.getGroupList()
|
||||
if (groupList.get(groupId)) {
|
||||
let group = await Bot.pickGroup(groupId, true)
|
||||
|
|
@ -28,7 +27,7 @@ export class SendDiceTool extends AbstractTool {
|
|||
let friend = await Bot.pickFriend(groupId)
|
||||
await friend.sendMsg(segment.dice(num))
|
||||
}
|
||||
return `the dice has been sent`
|
||||
return 'the dice has been sent'
|
||||
}
|
||||
|
||||
description = 'If you want to roll dice, use this tool. If you know the group number, use the group number instead of the qq number first. The input should be the number of dice to be cast (1-6) and the target group number or qq number,and they should be concat with a space'
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export class SendPictureTool extends AbstractTool {
|
|||
},
|
||||
groupId: {
|
||||
type: 'string',
|
||||
description: '群号或qq号,发送目标,为空则发送到当前聊天'
|
||||
description: 'the group number or qq number, will send to current conversation if leave blank'
|
||||
}
|
||||
},
|
||||
required: ['picture']
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { AbstractTool } from './AbstractTool.js'
|
||||
import {Config} from "../config.js";
|
||||
import {Config} from '../config.js';
|
||||
|
||||
export class WeatherTool extends AbstractTool {
|
||||
name = 'weather'
|
||||
|
|
@ -17,7 +17,9 @@ export class WeatherTool extends AbstractTool {
|
|||
func = async function (opts) {
|
||||
let { city } = opts
|
||||
let key = Config.amapKey
|
||||
|
||||
if (!key) {
|
||||
return 'query failed: you don\'t provide API key of 高德'
|
||||
}
|
||||
let adcodeRes = await fetch(`https://restapi.amap.com/v3/config/district?keywords=${city}&subdistrict=1&key=${key}`)
|
||||
adcodeRes = await adcodeRes.json()
|
||||
let adcode = adcodeRes.districts[0]?.adcode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue