Skip to content

Commit

Permalink
message with media through API don't open new ticket - fix #161
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Sep 15, 2024
1 parent 65170f4 commit 3231fb8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions backend/src/helpers/SendMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@ export const SendMessage = async (

let message;

const body = `\u200e${messageData.body}`;

if (messageData.mediaPath) {
const options = await getMessageOptions(
messageData.body,
messageData.mediaPath
);
const options = await getMessageOptions(body, messageData.mediaPath);
if (options) {
const body = fs.readFileSync(messageData.mediaPath);
message = await wbot.sendMessage(chatId, {
...options
});
}
} else {
const body = `\u200e${messageData.body}`;
message = await wbot.sendMessage(chatId, { text: body });
}

Expand Down

0 comments on commit 3231fb8

Please sign in to comment.