diff --git a/src/chat/functions/sendRawMessage.ts b/src/chat/functions/sendRawMessage.ts index cee7bbbf8f..b789219307 100644 --- a/src/chat/functions/sendRawMessage.ts +++ b/src/chat/functions/sendRawMessage.ts @@ -71,14 +71,15 @@ export async function sendRawMessage( if (rawMessage.type !== ('chat' || 'image' || 'video')) throw new WPPError( 'type_not_valid_for_newsletter', - 'Please, send a valid type for send message to newsletter. Valdi types: "chat", "image", "video"' + 'Please, send a valid type for send message to newsletter. Valid types: "chat", "image", "video"' ); const msg = new MsgModel(rawMessage as any); await addNewsletterMsgsRecords([await msgDataFromMsgModel(msg)]); const resultNewsletter = await sendNewsletterMessageJob({ msgData: rawMessage, - newsletterJid: chat.id.toString(), + msg: new MsgModel(rawMessage as any), type: rawMessage.type == 'chat' ? 'text' : 'media', + newsletterJid: chat.id.toString(), }); chat.msgs.add(msg); diff --git a/src/whatsapp/functions/sendNewsletterMessageJob.ts b/src/whatsapp/functions/sendNewsletterMessageJob.ts index c567e9ed21..40a2b1df27 100644 --- a/src/whatsapp/functions/sendNewsletterMessageJob.ts +++ b/src/whatsapp/functions/sendNewsletterMessageJob.ts @@ -19,7 +19,8 @@ import { exportModule } from '../exportModule'; /** @whatsapp 397995 */ export declare function sendNewsletterMessageJob(data: { - msgData: any; + msgData?: any; + msg?: any; newsletterJid: string; type: string; }): Promise<{ ack: { t: number }; serverId: number; success: boolean }>;