400 Bad Request returned by telegram api, "can't parse entities", logging could be improved as well
See original GitHub issueI had set up a telegram adapter. The chat ID was taken from @RawDataBot. Further, I have validated the token by running
curl -X GET https://api.telegram.org/botREDACTED:REDACTED
successfully.
The fredy dashboard says it has found 20 listings, but there was an error while sending the message to telegram. It would help if there were more debug statements, as currently it’s unclear what the api call payload was, only the response is logged.
shell@ubuntu-2gb-fsn1-6:~/fredy$ yarn run start
yarn run v1.22.5
$ node index.js
Started Fredy successfully. Ui can be accessed via http://localhost:9998
Started API service on port 9998
ErrorClass [HTTPError]: Response code 400 (Bad Request)
at IncomingMessage.<anonymous> (/home/shell/fredy/node_modules/yarl/main.js:179:22)
at IncomingMessage.emit (node:events:381:22)
at endReadableNT (node:internal/streams/readable:1307:12)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
host: 'api.telegram.org',
hostname: 'api.telegram.org',
method: 'POST',
path: '/botREDACTED:REDACTED/sendMessage',
response: {
statusCode: 400,
statusMessage: 'Bad Request',
body: `{"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 58"}`
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Telegram bot Can't find end of the entity starting at (truncated...)
But now I'm trying to use it in a Symfony 3.4 project and upon generating an error, telegram responds with: resulted in a...
Read more >Bots FAQ - Telegram APIs
General Questions. How do I create a bot? Creating Telegram bots is super-easy, but you will need at least some skills at computer...
Read more >test message succeeded, but "400 Bad Request" on real alerts
I'm currently trying to set up telegram alerts. From notification channel edit page I can successfully send test message and read it from...
Read more >python-telegram-bot Documentation - Read the Docs
You can even ask for help on Stack Overflow using the python-telegram-bot tag. ... parse_mode (str, optional) – Mode for parsing entities in...
Read more >TelegramClient | telegram - GramJS
See Api.TypeMessageEntity for allowed message entities. example: // gets the current parse mode. console.log("parse mode is :", client.parseMode) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It does work now, yay! My sister is really happy now 😃
About the PRs: I have a really hard time getting into untyped js code, so it’s not trivial for me 😄.
I will re-write the telegram adapter tomorrow (or on the weekend), it was on my todo list anyway as the lib im using is not maintained anymore and the code to send stuff to the botuser is pretty simple. This might (or might not) solve your issue…