mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 15:14:49 -06:00
feat: typebot send list
This commit is contained in:
parent
133eddd742
commit
1665654676
@ -245,11 +245,11 @@ export class TypebotService {
|
|||||||
|
|
||||||
const menuContent = formattedText.match(/\[menu\]([\s\S]*?)\[\/menu\]/)?.[1];
|
const menuContent = formattedText.match(/\[menu\]([\s\S]*?)\[\/menu\]/)?.[1];
|
||||||
if (menuContent) {
|
if (menuContent) {
|
||||||
const sections = menuContent.match(/\[section\]([\s\S]*?)(?=\[section\]|\[\/section\])/g);
|
const sections = menuContent.match(/\[section\]([\s\S]*?)(?=\[section\]|\[\/section\]|\[\/menu\])/g);
|
||||||
if (sections) {
|
if (sections) {
|
||||||
sections.forEach((section) => {
|
sections.forEach((section) => {
|
||||||
const sectionTitle = section.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim();
|
const sectionTitle = section.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim();
|
||||||
const rows = section.match(/\[row\]([\s\S]*?)(?=\[row\]|\[\/section\]|\[\/menu\])/g);
|
const rows = section.match(/\[row\]([\s\S]*?)(?=\[row\]|\[\/row\]|\[\/section\]|\[\/menu\])/g);
|
||||||
|
|
||||||
const sectionData = {
|
const sectionData = {
|
||||||
title: sectionTitle,
|
title: sectionTitle,
|
||||||
@ -437,11 +437,11 @@ export class TypebotService {
|
|||||||
|
|
||||||
const menuContent = formattedText.match(/\[menu\]([\s\S]*?)\[\/menu\]/)?.[1];
|
const menuContent = formattedText.match(/\[menu\]([\s\S]*?)\[\/menu\]/)?.[1];
|
||||||
if (menuContent) {
|
if (menuContent) {
|
||||||
const sections = menuContent.match(/\[section\]([\s\S]*?)(?=\[section\]|\[\/section\])/g);
|
const sections = menuContent.match(/\[section\]([\s\S]*?)(?=\[section\]|\[\/section\]|\[\/menu\])/g);
|
||||||
if (sections) {
|
if (sections) {
|
||||||
sections.forEach((section) => {
|
sections.forEach((section) => {
|
||||||
const sectionTitle = section.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim();
|
const sectionTitle = section.match(/title: (.*?)(?:\n|$)/)?.[1]?.trim();
|
||||||
const rows = section.match(/\[row\]([\s\S]*?)(?=\[row\]|\[\/section\]|\[\/menu\])/g);
|
const rows = section.match(/\[row\]([\s\S]*?)(?=\[row\]|\[\/row\]|\[\/section\]|\[\/menu\])/g);
|
||||||
|
|
||||||
const sectionData = {
|
const sectionData = {
|
||||||
title: sectionTitle,
|
title: sectionTitle,
|
||||||
|
Loading…
Reference in New Issue
Block a user