Skip to content

Commit

Permalink
fix: Fixed send newsletter text message (close #1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Apr 11, 2024
1 parent 7fc192e commit a041474
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/chat/functions/sendRawMessage.ts
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion src/whatsapp/functions/sendNewsletterMessageJob.ts
Expand Up @@ -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 }>;
Expand Down

0 comments on commit a041474

Please sign in to comment.