mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +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 WeatherTool(),
|
||||||
new SendPictureTool(),
|
new SendPictureTool(),
|
||||||
new TTSTool(),
|
new TTSTool(),
|
||||||
|
|
||||||
serpTool
|
serpTool
|
||||||
]
|
]
|
||||||
let img = []
|
let img = []
|
||||||
|
|
@ -2053,12 +2052,12 @@ export class chatgpt extends plugin {
|
||||||
let { name, arguments: args } = msg.functionCall
|
let { name, arguments: args } = msg.functionCall
|
||||||
args = JSON.parse(args)
|
args = JSON.parse(args)
|
||||||
if (!args.groupId) {
|
if (!args.groupId) {
|
||||||
args.groupId = e.group_id || e.sender.user_id
|
args.groupId = e.group_id + '' || e.sender.user_id + ''
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
parseInt(args.groupId)
|
parseInt(args.groupId)
|
||||||
} catch (err) {
|
} 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))
|
let functionResult = await fullFuncMap[name].exec(Object.assign({ isAdmin, sender }, args))
|
||||||
logger.mark(`function ${name} execution result: ${functionResult}`)
|
logger.mark(`function ${name} execution result: ${functionResult}`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue