fix(whatsapp.gblib): Fix broadcasts.

This commit is contained in:
Rodrigo Rodriguez 2024-07-09 16:33:09 -03:00
parent 453b663394
commit e63ff1482e

View file

@ -52,6 +52,7 @@ import Fs from 'fs';
import twilio from 'twilio'; import twilio from 'twilio';
import Nexmo from 'nexmo'; import Nexmo from 'nexmo';
import { join } from 'path'; import { join } from 'path';
import Path from 'path';
import shell from 'any-shell-escape'; import shell from 'any-shell-escape';
import { exec } from 'child_process'; import { exec } from 'child_process';
import prism from 'prism-media'; import prism from 'prism-media';
@ -661,8 +662,10 @@ export class GBConversationalService {
text = text.replace(/\n/g, '\\n'); text = text.replace(/\n/g, '\\n');
} }
let template = isMedia ? Path.basename(image) : 'broadcast1'
let data: any = { let data: any = {
name: isMedia ? 'broadcast_notext' : 'broadcast1', name: template ,
components: [ components: [
{ {
type: 'header', type: 'header',