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