Feat add. variables {{name}} the message sent

This commit is contained in:
Wender Teixeira
2022-01-12 00:31:12 -03:00
parent 783c05d172
commit f4653aaaf4
6 changed files with 66 additions and 18 deletions

View File

@@ -6,6 +6,8 @@ import SerializeWbotMsgId from "../../helpers/SerializeWbotMsgId";
import Message from "../../models/Message";
import Ticket from "../../models/Ticket";
import formatBody from "../../helpers/Mustache";
interface Request {
body: string;
ticket: Ticket;
@@ -28,7 +30,7 @@ const SendWhatsAppMessage = async ({
try {
const sentMessage = await wbot.sendMessage(
`${ticket.contact.number}@${ticket.isGroup ? "g" : "c"}.us`,
body,
formatBody(body, ticket.contact),
{
quotedMessageId: quotedMsgSerializedId,
linkPreview: false