I want to send a message from Telegram Bot to user with parse_mode 'HTML' . I use node.js with telegram.bot.api. But I've got an error
I've tried to write a code without parse_mode='HTML'. And it is working. But if I only add parse_mode=''(html or markdown) node.js show me: "error: [polling_error] {}"
Wrong code:
const chatId=msg.chat.id;
if (msg.text=='test'){
bot.sendMessage(chatId,'<b>TEST</b>', parse_mode='HTML');
return;
}
})
Working code
const chatId=msg.chat.id;
if (msg.text=='test'){
bot.sendMessage(chatId,'<b>TEST</b>');
return;
}
})
I cant find any solution and info about parse_mode='HTML' and "error: [polling_error] {}".
Try sending the parse mode as on object;
bot.sendMessage(chatId, '<b>TEST</b>', {parse_mode: 'HTML'});