trim text

This commit is contained in:
ikechan8370 2025-03-21 12:23:02 +08:00
parent 89e265195d
commit 2fad551144

View file

@ -186,7 +186,7 @@ export async function toYunzai (e, contents) {
for (let content of contents) {
switch (content.type) {
case 'text': {
msgs.push((/** @type {import('chaite').TextContent} **/ content).text)
msgs.push((/** @type {import('chaite').TextContent} **/ content).text?.trim() || '')
break
}
case 'image': {
@ -208,6 +208,6 @@ export async function toYunzai (e, contents) {
}
}
return {
msgs, forward
msgs: msgs.filter(i => !!i), forward
}
}