fix: 错误过滤非文本消息的问题

This commit is contained in:
ikechan8370 2025-02-15 23:08:03 +08:00
parent 1911e5ca4b
commit afa456f044
2 changed files with 6 additions and 3 deletions

View file

@ -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 () {

View file

@ -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
} }