Skip to content

Commit

Permalink
fix: groupId 格式问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Jun 25, 2023
1 parent de8cc48 commit feb6b31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions apps/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,6 @@ export class chatgpt extends plugin {
new WeatherTool(),
new SendPictureTool(),
new TTSTool(),

serpTool
]
let img = []
Expand Down Expand Up @@ -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}`)
Expand Down
2 changes: 1 addition & 1 deletion utils/tools/TTSTool.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down

0 comments on commit feb6b31

Please sign in to comment.