From c355f256adfb2510acec8e3cbab64cca3ffff0b3 Mon Sep 17 00:00:00 2001 From: Anton Voylenko Date: Sat, 18 Nov 2023 22:54:15 +0200 Subject: [PATCH] support media with text message --- src/controllers/clientController.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controllers/clientController.js b/src/controllers/clientController.js index 9843cf12..0971e3dd 100644 --- a/src/controllers/clientController.js +++ b/src/controllers/clientController.js @@ -73,6 +73,10 @@ const sendMessage = async (req, res) => { let messageOut switch (contentType) { case 'string': + if (options.media) { + const media = options.media + options.media = new MessageMedia(media.mimetype, media.data, media.filename = null, media.filesize = null) + } messageOut = await client.sendMessage(chatId, content, options) break case 'MessageMediaFromURL': {