500 - Internal Server Error Body { "status": 500, "error": "Internal Server Error", "response": { "message": "\nInvalid `S.integrationSession.update()` invocation in\n/evolution/dist/main.js:161:19140\n\n 158 `));let g=\"\";d.bold&&(g+=\"*\"),d.italic&&(g+=\"_\"),d.underline&&(g+=\"~\");let m=`${g}${u}${g.split(\"\").reverse().join(\"\")}`;return d.url&&(m=d.children[0]?.text?`[${m}]\n 159 (${d.url})`:`${d.url}`),m}async function l(d,u,g,m,h,y,w,S){for(let E of m){if(E.type===\"text\"){let b=\"\";for(let C of E.content.richText){for(let N of C.children)b+=w(N);b+=`\n 160 `}if(b=b.replace(/\\*\\*/g,\"\").replace(/__/,\"\").replace(/~~/,\"\").replace(/\\n$/,\"\"),b=b.replace(/\\n$/,\"\"),b.includes(\"[list]\")){let C={number:s.split(\"@\")[0],title:\"\",description:\"\",buttonText:\"\",footerText:\"\",sections:[]},N=b.match(/\\[title\\]([\\s\\S]*?)(?=\\[description\\])/),_=b.match(/\\[description\\]([\\s\\S]*?)(?=\\[buttonText\\])/),x=b.match(/\\[buttonText\\]([\\s\\S]*?)(?=\\[footerText\\])/),L=b.match(/\\[footerText\\]([\\s\\S]*?)(?=\\[menu\\])/);N&&(C.title=N[1].trim()),_&&(C.description=_[1].trim()),x&&(C.buttonText=x[1].trim()),L&&(C.footerText=L[1].trim());let W=b.match(/\\[menu\\]([\\s\\S]*?)\\[\\/menu\\]/)?.[1];if(W){let G=W.match(/\\[section\\]([\\s\\S]*?)(?=\\[section\\]|\\[\\/section\\]|\\[\\/menu\\])/g);G&&G.forEach(K=>{let V=K.match(/title: (.*?)(?:\\n|$)/)?.[1]?.trim(),$=K.match(/\\[row\\]([\\s\\S]*?)(?=\\[row\\]|\\[\\/row\\]|\\[\\/section\\]|\\[\\/menu\\])/g),X={title:V,rows:$?.map(Cn=>({title:Cn.match(/title: (.*?)(?:\\n|$)/)?.[1]?.trim(),description:Cn.match(/description: (.*?)(?:\\n|$)/)?.[1]?.trim(),rowId:Cn.match(/rowId: (.*?)(?:\\n|$)/)?.[1]?.trim()}))||[]};C.sections.push(X)})}await d.listMessage(C)}else if(b.includes(\"[buttons]\")){let C={number:s.split(\"@\")[0],thumbnailUrl:void 0,title:\"\",description:\"\",footer:\"\",buttons:[]},N=b.match(/\\[thumbnailUrl\\]([\\s\\S]*?)(?=\\[title\\])/),_=b.match(/\\[title\\]([\\s\\S]*?)(?=\\[description\\])/),x=b.match(/\\[description\\]([\\s\\S]*?)(?=\\[footer\\])/),L=b.match(/\\[footer\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url))/);_&&(C.title=_[1].trim()),N&&(C.thumbnailUrl=N[1].trim()),x&&(C.description=x[1].trim()),L&&(C.footer=L[1].trim());let W={reply:/\\[reply\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,pix:/\\[pix\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,copy:/\\[copy\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,call:/\\[call\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,url:/\\[url\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g};for(let[G,K]of Object.entries(W)){let V;for(;(V=K.exec(b))!==null;){let $=V[1].trim(),X={type:G};switch(G){case\"pix\":X.currency=$.match(/currency: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.name=$.match(/name: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.keyType=$.match(/keyType: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.key=$.match(/key: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"reply\":X.displayText=$.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.id=$.match(/id: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"copy\":X.displayText=$.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.copyCode=$.match(/copyCode: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"call\":X.displayText=$.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.phoneNumber=$.match(/phone: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"url\":X.displayText=$.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),X.url=$.match(/url: (.*?)(?:\\n|$)/)?.[1]?.trim();break}Object.keys(X).length>1&&C.buttons.push(X)}}await d.buttonMessage(C)}else await d.textMessage({number:s.split(\"@\")[0],delay:g?.delayMessage||1e3,text:b},!1);H(\"/message/sendText\")}E.type===\"image\"&&(await d.mediaMessage({number:s.split(\"@\")[0],delay:g?.delayMessage||1e3,mediatype:\"image\",media:E.content.url},null,!1),H(\"/message/sendMedia\")),E.type===\"video\"&&(await d.mediaMessage({number:s.split(\"@\")[0],delay:g?.delayMessage||1e3,mediatype:\"video\",media:E.content.url},null,!1),H(\"/message/sendMedia\")),E.type===\"audio\"&&(await d.audioWhatsapp({number:s.split(\"@\")[0],delay:g?.delayMessage||1e3,encoding:!0,audio:E.content.url},!1),H(\"/message/sendWhatsAppAudio\"));let I=a(y,E.id);I&&await new Promise(b=>setTimeout(b,I*1e3))}if(console.log(\"input\",h),h){if(h.type===\"choice input\"){let E=\"\",I=h.items;for(let b of I)E+=`\\u25B6\\uFE0F ${b.content}\n→ 161 `;if(E=E.replace(/\\n$/,\"\"),E.includes(\"[list]\")){let b={number:s.split(\"@\")[0],title:\"\",description:\"\",buttonText:\"\",footerText:\"\",sections:[]},C=E.match(/\\[title\\]([\\s\\S]*?)(?=\\[description\\])/),N=E.match(/\\[description\\]([\\s\\S]*?)(?=\\[buttonText\\])/),_=E.match(/\\[buttonText\\]([\\s\\S]*?)(?=\\[footerText\\])/),x=E.match(/\\[footerText\\]([\\s\\S]*?)(?=\\[menu\\])/);C&&(b.title=C[1].trim()),N&&(b.description=N[1].trim()),_&&(b.buttonText=_[1].trim()),x&&(b.footerText=x[1].trim());let L=E.match(/\\[menu\\]([\\s\\S]*?)\\[\\/menu\\]/)?.[1];if(L){let W=L.match(/\\[section\\]([\\s\\S]*?)(?=\\[section\\]|\\[\\/section\\]|\\[\\/menu\\])/g);W&&W.forEach(G=>{let K=G.match(/title: (.*?)(?:\\n|$)/)?.[1]?.trim(),V=G.match(/\\[row\\]([\\s\\S]*?)(?=\\[row\\]|\\[\\/row\\]|\\[\\/section\\]|\\[\\/menu\\])/g),$={title:K,rows:V?.map(X=>({title:X.match(/title: (.*?)(?:\\n|$)/)?.[1]?.trim(),description:X.match(/description: (.*?)(?:\\n|$)/)?.[1]?.trim(),rowId:X.match(/rowId: (.*?)(?:\\n|$)/)?.[1]?.trim()}))||[]};b.sections.push($)})}await d.listMessage(b)}else if(E.includes(\"[buttons]\")){let b={number:s.split(\"@\")[0],thumbnailUrl:void 0,title:\"\",description:\"\",footer:\"\",buttons:[]},C=E.match(/\\[thumbnailUrl\\]([\\s\\S]*?)(?=\\[title\\])/),N=E.match(/\\[title\\]([\\s\\S]*?)(?=\\[description\\])/),_=E.match(/\\[description\\]([\\s\\S]*?)(?=\\[footer\\])/),x=E.match(/\\[footer\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url))/);N&&(b.title=N[1].trim()),C&&(b.thumbnailUrl=C[1].trim()),_&&(b.description=_[1].trim()),x&&(b.footer=x[1].trim());let L={reply:/\\[reply\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,pix:/\\[pix\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,copy:/\\[copy\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,call:/\\[call\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g,url:/\\[url\\]([\\s\\S]*?)(?=\\[(?:reply|pix|copy|call|url)|$)/g};for(let[W,G]of Object.entries(L)){let K;for(;(K=G.exec(E))!==null;){let V=K[1].trim(),$={type:W};switch(W){case\"pix\":$.currency=V.match(/currency: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.name=V.match(/name: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.keyType=V.match(/keyType: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.key=V.match(/key: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"reply\":$.displayText=V.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.id=V.match(/id: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"copy\":$.displayText=V.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.copyCode=V.match(/copyCode: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"call\":$.displayText=V.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.phoneNumber=V.match(/phone: (.*?)(?:\\n|$)/)?.[1]?.trim();break;case\"url\":$.displayText=V.match(/displayText: (.*?)(?:\\n|$)/)?.[1]?.trim(),$.url=V.match(/url: (.*?)(?:\\n|$)/)?.[1]?.trim();break}Object.keys($).length>1&&b.buttons.push($)}}await d.buttonMessage(b)}else await d.textMessage({number:s.split(\"@\")[0],delay:g?.delayMessage||1e3,text:E},!1);H(\"/message/sendText\")}await S.integrationSession.update({\n where: {\n instanceId: \"4294cd28-b294-4d9d-808f-2c06e7c3a226\",\n remoteJid: \"555499157762@s.whatsapp.net\",\n keyId: \"3EB073F4C43F7B379C88F8E4CD47472461BACEC2\"\n },\n take: undefined,\n + skip: Int\n })\n\nArgument `skip` is missing." } }