Bug Report
I have read:
I am using the latest version of the library.
Using Markdown to parse my chat message.
Getting error "Can't parse message text: Can't find end of the entity starting at byte offset 3"
bot.sendMessage(chatID, "I will throw the error!", {
parse_mode: "Markdown"
})
bot.sendMessage(chatID, "I wont throw the error!", {
parse_mode: "markdown"
})
Simply changing "Markdown" -> "markdown" reproduces this issue.
I can not seem to reproduce this bug.
I'm sorry, it seems that I must have changed something else beyond uppercasing the M.
You can close this and if I find time to look for what reproduced it, I will get back to you.
Okay. We will be waiting.
I'm having the same kind of error Can't parse message text: Can't find end of the entity starting at byte offset xxx, and I'm using markdown parsing
It's completely random (I have ~500 events/h on the bot (private company bot))
ex in production:
no errors in the last 7 days
many errors the week before
21 days uptime
cannot reproduce bug in local
I'm essentially here to get updates on the issue...
There is probably an extra markdown element in the message you are sending. Usernames can contain underscores which has caused my bots to generate this message before I changed to HTML style. https://core.telegram.org/bots/api#markdown-style
As @monkeydave suggests, this is probably due to formatting issues with your message text. If you do not need markdown support, disable it entirely to avoid such issues.
I need markdown :( I'm gonna try to debug my templates thanks!
Solution
bot.sendMessage(chatId,message, {parse_mode: 'HTML'});
Most helpful comment
Solution
bot.sendMessage(chatId,message, {parse_mode: 'HTML'});