Comments (11)
The issue is definitely the unclosed underscore.
curl -XPOST -H 'content-type: application/json' https://api.telegram.org/$TELEGRAM_TOKEN/sendMessage -d @/tmp/test.json
contents of /tmp/test.json should be
{
"chat_id": 344335405,
"text": "This unmatched_underscore breaks telegram markdown parsing",
"reply_to_message_id": 8,
"parse_mode": "Markdown"
}
response:
{"ok":false,"error_code":400,"description":"Bad Request: can't parse entities in message text: Can't find end of the entity starting at byte offset 14"}
I'm asking telegram bot help about this, I'll let you know what they say. Other markdown parsers that I've used will just leave a literal underscore when there's no second, closing underscore. And in fact that's how it works if you write an underscore in the web client, so I don't see why it should work differently for the bot API.
from hubot-telegram.
got the same error, calling the bot by botname or @botName too
[Mon Jan 23 2017 06:26:39 GMT+0000 (GMT)] ERROR Error: Bad Request: Can't parse message text: Can't find end of the entity starting at byte offset 483
at Function.TelegramBot.error (/root/blueskygroupbot/node_modules/telegrambot/lib/telegrambot.js:26:15)
at Request._callback (/root/blueskygroupbot/node_modules/telegrambot/lib/telegrambot.js:47:66)
at Request.self.callback (/root/blueskygroupbot/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/root/blueskygroupbot/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/root/blueskygroupbot/node_modules/request/request.js:1001:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Mon Jan 23 2017 06:26:39 GMT+0000 (GMT)] ERROR hubot-bangbang: DOES NOT COMPUTE
[Mon Jan 23 2017 06:27:45 GMT+0000 (GMT)] INFO Receiving message_id: 5
[Mon Jan 23 2017 06:27:45 GMT+0000 (GMT)] ERROR Error: Bad Request: Can't parse message text: Can't find end of the entity starting at byte offset 483
at Function.TelegramBot.error (/root/blueskygroupbot/node_modules/telegrambot/lib/telegrambot.js:26:15)
at Request._callback (/root/blueskygroupbot/node_modules/telegrambot/lib/telegrambot.js:47:66)
at Request.self.callback (/root/blueskygroupbot/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/root/blueskygroupbot/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/root/blueskygroupbot/node_modules/request/request.js:1001:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Mon Jan 23 2017 06:27:45 GMT+0000 (GMT)] ERROR hubot-bangbang: DOES NOT COMPUTE
from hubot-telegram.
Ok strange, I will try to look at this asap, thx guys for reporting it 👍
from hubot-telegram.
Hi, same problem here, or similar at least, on my tests it's seems has something to do with the markdown support in the messages and underscores (_) ie:
Jan 23 02:06:23 ambrosio-tele app/web.1: [Mon Jan 23 2017 11:06:23 GMT+0100 (CET)] INFO hubot-rss-reader: Pokémon ¿qué? http://elpais.com/cultura/2017/01/22/television/1485084013_172502.html#?ref=rss&format=simple&link=link => 133188453
Jan 23 02:06:25 ambrosio-tele app/web.1: [M
:
Jan 23 02:06:23 ambrosio-tele app/web.1: [Mon Jan 23 2017 11:06:23 GMT+0100 (CET)] INFO hubot-rss-reader: Pokémon ¿qué? http://elpais.com/cultura/2017/01/22/television/1485084013_172502.html#?ref=rss&format=simple&link=link => 133188453
Jan 23 02:06:25 ambrosio-tele app/web.1: [Mon Jan 23 2017 11:06:25 GMT+0100 (CET)] ERROR Error: Bad Request: Can't parse message text: Can't find end of the entity starting at byte offset 135
Jan 23 02:06:25 ambrosio-tele app/web.1: at Function.TelegramBot.error (/app/node_modules/telegrambot/lib/telegrambot.js:26:15)
Jan 23 02:06:25 ambrosio-tele app/web.1: at Request._callback (/app/node_modules/telegrambot/lib/telegrambot.js:47:66)
Jan 23 02:06:25 ambrosio-tele app/web.1: at Request.self.callback (/app/node_modules/request/request.js:186:22)
Jan 23 02:06:25 ambrosio-tele app/web.1: at emitTwo (events.js:106:13)
Jan 23 02:06:25 ambrosio-tele app/web.1: at Request.emit (events.js:191:7)
Jan 23 02:06:25 ambrosio-tele app/web.1: at Request.<anonymous> (/app/node_modules/request/request.js:1081:10)
Jan 23 02:06:25 ambrosio-tele app/web.1: at emitOne (events.js:96:13)
Jan 23 02:06:25 ambrosio-tele app/web.1: at Request.emit (events.js:188:7)
Jan 23 02:06:25 ambrosio-tele app/web.1: at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1001:12)
Jan 23 02:06:25 ambrosio-tele app/web.1: at IncomingMessage.g (events.js:291:16)
Jan 23 02:06:25 ambrosio-tele app/web.1: at emitNone (events.js:91:20)
Jan 23 02:06:25 ambrosio-tele app/web.1: at IncomingMessage.emit (events.js:185:7)
Jan 23 02:06:25 ambrosio-tele app/web.1: at endReadableNT (_stream_readable.js:974:12)
Jan 23 02:06:25 ambrosio-tele app/web.1: at _combinedTickCallback (internal/process/next_tick.js:74:11)
Jan 23 02:06:25 ambrosio-tele app/web.1: at process._tickCallback (internal/process/next_tick.js:98:9)
Notice the underscore in the msg.
Thanks, salud!
from hubot-telegram.
Forgot to say, I've markdown formated responses that work just fine, the problem appears with "unclosed" markdown ie: "_something_
" => something works, "some_thing" fails.
from hubot-telegram.
any progress? still failing on my side even with the workaround
from hubot-telegram.
Hm works with help but not better-help
from hubot-telegram.
I have the same issue with hubot-better-help
doesent work with "hubot help"
But does work when calling help on a command "hubot help adapter"
from hubot-telegram.
@gburgett Any update on this, I see the problem is persisting.
from hubot-telegram.
@surfer190 this was the latest info that I have from two years ago: CruAlbania/hubot-better-help#3
You could repeat the curl command above and test whether their markdown parsing is still broken.
from hubot-telegram.
@gburgett Yes, same response.
http POST https://api.telegram.org/botXXX:YYY/sendMessage < test.json
returns:
{
"description": "Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 14",
"error_code": 400,
"ok": false
}
from hubot-telegram.
Related Issues (20)
- Receiving double messages when polling
- ERROR Error: HTTP status 504 returned. HOT 2
- ERROR TypeError: Cannot read property 'message_id' of undefined HOT 11
- bot no receiving messages from supergroup HOT 5
- API fields have been renamed HOT 2
- Remove bot name when using /command@bot_name HOT 1
- Maximum call stack size exceeded HOT 6
- Slow connectivity causes duplicate messages HOT 2
- Newbie request
- Expose reply_to_message from message
- Add `hubot-adapter` topic HOT 1
- / commands in supergroups not working HOT 2
- Proxy issues HOT 1
- CoffeeScript 2.x support HOT 2
- Read the response text of a message HOT 1
- Group Chat Slash Command With Mention HOT 1
- Interval Issue HOT 1
- Markdown with Bad Entities
- Error seeking help HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubot-telegram.