mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 错误过滤非文本消息的问题
This commit is contained in:
parent
1911e5ca4b
commit
afa456f044
2 changed files with 6 additions and 3 deletions
|
|
@ -2,8 +2,8 @@ import { Config } from '../utils/config.js'
|
||||||
import { getChatHistoryGroup } from '../utils/chat.js'
|
import { getChatHistoryGroup } from '../utils/chat.js'
|
||||||
import { convertFaces } from '../utils/face.js'
|
import { convertFaces } from '../utils/face.js'
|
||||||
import { customSplitRegex, filterResponseChunk } from '../utils/text.js'
|
import { customSplitRegex, filterResponseChunk } from '../utils/text.js'
|
||||||
import core, {roleMap} from '../model/core.js'
|
import core, { roleMap } from '../model/core.js'
|
||||||
import {formatDate} from '../utils/common.js'
|
import { formatDate } from '../utils/common.js'
|
||||||
|
|
||||||
export class bym extends plugin {
|
export class bym extends plugin {
|
||||||
constructor () {
|
constructor () {
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,12 @@
|
||||||
* @param msg
|
* @param msg
|
||||||
*/
|
*/
|
||||||
export function filterResponseChunk (msg) {
|
export function filterResponseChunk (msg) {
|
||||||
if (!msg || typeof msg !== 'string') {
|
if (!msg) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if (typeof msg !== 'string') {
|
||||||
|
return msg
|
||||||
|
}
|
||||||
if (!msg.trim()) {
|
if (!msg.trim()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue