mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: add trim
This commit is contained in:
parent
a1b450abaa
commit
6628b8837b
1 changed files with 3 additions and 3 deletions
|
|
@ -1030,7 +1030,7 @@ export class chatgpt extends plugin {
|
||||||
await redis.set(key, JSON.stringify(previousConversation), Config.conversationPreserveTime > 0 ? { EX: Config.conversationPreserveTime } : {})
|
await redis.set(key, JSON.stringify(previousConversation), Config.conversationPreserveTime > 0 ? { EX: Config.conversationPreserveTime } : {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let response = chatMessage?.text
|
let response = chatMessage?.text?.replace('\n\n\n', '\n')
|
||||||
// 过滤无法正常显示的emoji
|
// 过滤无法正常显示的emoji
|
||||||
if (use === 'claude') response = response.replace(/:[a-zA-Z_]+:/g, '')
|
if (use === 'claude') response = response.replace(/:[a-zA-Z_]+:/g, '')
|
||||||
let mood = 'blandness'
|
let mood = 'blandness'
|
||||||
|
|
@ -2035,7 +2035,7 @@ export class chatgpt extends plugin {
|
||||||
logger.info(msg)
|
logger.info(msg)
|
||||||
while (msg.functionCall) {
|
while (msg.functionCall) {
|
||||||
if (msg.text) {
|
if (msg.text) {
|
||||||
await e.reply(msg.text)
|
await e.reply(msg.text.replace('\n\n\n', '\n'))
|
||||||
}
|
}
|
||||||
let { name, arguments: args } = msg.functionCall
|
let { name, arguments: args } = msg.functionCall
|
||||||
args = JSON.parse(args)
|
args = JSON.parse(args)
|
||||||
|
|
@ -2048,7 +2048,7 @@ export class chatgpt extends plugin {
|
||||||
} 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), e)
|
let functionResult = await fullFuncMap[name.trim()].exec(Object.assign({ isAdmin, sender }, args), e)
|
||||||
logger.mark(`function ${name} execution result: ${functionResult}`)
|
logger.mark(`function ${name} execution result: ${functionResult}`)
|
||||||
option.parentMessageId = msg.id
|
option.parentMessageId = msg.id
|
||||||
option.name = name
|
option.name = name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue