mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-27 02:48:39 -06:00
Fix: Array message from typebot get only last one to show
This commit is contained in:
parent
380d6a43a5
commit
51ed67a53e
@ -412,12 +412,15 @@ export class TypebotService {
|
|||||||
let formattedText = '';
|
let formattedText = '';
|
||||||
|
|
||||||
let linkPreview = false;
|
let linkPreview = false;
|
||||||
|
|
||||||
for (const richText of message.content.richText) {
|
for (const richText of message.content.richText) {
|
||||||
if (richText.type === 'variable') {
|
if (richText.type === 'variable') {
|
||||||
for (const child of richText.children) {
|
for (const child of richText.children) {
|
||||||
for (const grandChild of child.children) {
|
for (const grandChild of child.children) {
|
||||||
formattedText += grandChild.text;
|
if (grandChild.text.startsWith('[') && grandChild.text.endsWith(']')) {
|
||||||
|
formattedText += JSON.parse(grandChild.text).slice(-1)[0];
|
||||||
|
} else {
|
||||||
|
formattedText += grandChild.text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user