mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: groupId 格式问题
This commit is contained in:
parent
de8cc48156
commit
feb6b31994
2 changed files with 3 additions and 4 deletions
|
|
@ -1989,7 +1989,6 @@ export class chatgpt extends plugin {
|
|||
new WeatherTool(),
|
||||
new SendPictureTool(),
|
||||
new TTSTool(),
|
||||
|
||||
serpTool
|
||||
]
|
||||
let img = []
|
||||
|
|
@ -2053,12 +2052,12 @@ export class chatgpt extends plugin {
|
|||
let { name, arguments: args } = msg.functionCall
|
||||
args = JSON.parse(args)
|
||||
if (!args.groupId) {
|
||||
args.groupId = e.group_id || e.sender.user_id
|
||||
args.groupId = e.group_id + '' || e.sender.user_id + ''
|
||||
}
|
||||
try {
|
||||
parseInt(args.groupId)
|
||||
} catch (err) {
|
||||
args.groupId = e.group_id || e.sender.user_id
|
||||
args.groupId = e.group_id + '' || e.sender.user_id + ''
|
||||
}
|
||||
let functionResult = await fullFuncMap[name].exec(Object.assign({ isAdmin, sender }, args))
|
||||
logger.mark(`function ${name} execution result: ${functionResult}`)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { AbstractTool } from './AbstractTool.js'
|
||||
import {convertSpeaker, generateAudio} from '../tts.js'
|
||||
import { convertSpeaker, generateAudio } from '../tts.js'
|
||||
import uploadRecord from '../uploadRecord.js'
|
||||
import { Config } from '../config.js'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue