question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

400 Bad Request returned by telegram api, "can't parse entities", logging could be improved as well

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
carstenhagcommented, May 14, 2021

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 😄.

1reaction
orangecodingcommented, May 13, 2021

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found