Telegram Bot API + Node-RED
I am facing an issue, or maybe it’s just my mistake. I would really appreciate it if someone could help me. I’m using the following Node in NODE-RED to send a formatted text to Telegram. However, the output only shows the formatting characters (* / _ / etc.) instead of applying the formatting.
Here is the node CODE:
`
let queryData = flow.get(‘queryData’) || {};
let imageBuffer = msg.payload;
let releaseYear = (queryData.release_date || ‘N/A’);
let parts = releaseYear.split(“-“);
let formattedDate = ${parts[2]}-${parts[1]}-${parts[0]};
let nota = parseFloat(queryData.rating).toFixed(1);
let categoria = (queryData.category_midia || ‘N/A’);
let genero = (queryData.genre).split(“,”).map(word => #${word.trim().replace(/\s+/g, '')});
let generoTag = genero.join(” “);
msg.payload = {
chatId: ‘-*******’,
type: ‘photo’,
content: imageBuffer,
caption: ๐ฌ *NEW IN THE ${categoria} CATALOG* ๐ฌ\n\n +
๐ *Title*: ${queryData.filme_titulo || 'N/A'}\n +
๐ *Original Title*: ${queryData.filme_titulo_original || 'N/A'}\n +
๐
*Release Date*: ${formattedDate || 'N/A'}\n +๐ฅ *Average Rating*: ${nota || 'N/A'}\n +
๐ฅ *Genres*: ${generoTag || 'N/A'}\n +
๐ *Synopsis*: _${queryData.description_f || 'N/A'}_,
parse_mode: ‘MarkdownV2’
};
return msg;
`
this node pallet used: flows.nodered.org/node/node-red-contrib-telegrambot
I’ve tried using: Markdown / MarkdownV2 / markdown / HTML, but nothing comes out formatted.
Here is the output. In img.
I’ve tried using: Markdown / MarkdownV2 / markdown / HTML, but nothing comes out formatted.
Read more here: Source link
