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.

Can't parse entities: character '-' is reserved and must be escaped with the preceding '\'

See original GitHub issue

Hello, I tried to run the bot for the first time and got these errors

2021-04-27 14:36:17,369 - btb_manager_telegram_logger - INFO - Retrieving Telegram token and chat_id from apprise.yml file.
2021-04-27 14:36:17,370 - btb_manager_telegram_logger - INFO - Successfully retrieved Telegram configuration. The bot will only respond to user in the chat with chat_id XXXXXXX
2021-04-27 14:36:18,372 - btb_manager_telegram_logger - INFO - Checking for updates.
2021-04-27 14:36:20,754 - apscheduler.scheduler - INFO - Scheduler started
2021-04-27 14:36:28,630 - btb_manager_telegram_logger - INFO - Started conversation.
2021-04-27 14:36:28,818 - telegram.ext.dispatcher - ERROR - No error handlers are registered, logging exception.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/ext/dispatcher.py", line 442, in process_update
    handler.handle_update(update, self, check, context)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/ext/conversationhandler.py", line 549, in handle_update
    new_state = handler.handle_update(update, dispatcher, check_result, context)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/ext/handler.py", line 160, in handle_update
    return self.callback(update, context)
  File "/Users/XXXXXX/BTB-manager-telegram/btb_manager_telegram/handlers.py", line 251, in start
    update.message.reply_text(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/message.py", line 689, in reply_text
    return self.bot.send_message(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/bot.py", line 127, in decorator
    result = func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/bot.py", line 475, in send_message
    return self._message(  # type: ignore[return-value]
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/bot.py", line 296, in _message
    result = self._post(endpoint, data, timeout=timeout, api_kwargs=api_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/bot.py", line 259, in _post
    return self.request.post(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/utils/request.py", line 349, in post
    result = self._request_wrapper(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/telegram/utils/request.py", line 272, in _request_wrapper
    raise BadRequest(message)
telegram.error.BadRequest: Can't parse entities: character '-' is reserved and must be escaped with the preceding '\'

Have you ever seen this error ? Cheers

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lorcalhostcommented, Apr 27, 2021

@SH-Stark perfect, thanks for helping us pinpoint the issue.
I will push a fix shortly.

1reaction
SH-Starkcommented, Apr 27, 2021

Problem fixed, my First Name had a “-”, removing it seems to solve the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telegram does not escape some markdown characters
must be escaped with the preceding character '\'. ... if the prase_mode argument is set to markdown instead of using the ParseMode.
Read more >
[BUG] Escaping markdown doesn't always work correctly #2371
Telegram replies with error: ‼️ Telegram ERROR: Can't parse entities: character '.' is reserved and must be escaped with the preceding '\' ...
Read more >
Telegram bot error sending messags with "_" - Configuration
Telegram bot rejects all messages like this: Error sending message: Can't parse entities: can't find end of the entity starting at byte ...
Read more >
Reserved Characters in SSML - Amazon Polly
Must be escaped when in a attribute value delimited by double quotes. For example, in the following AWS CLI code · Do not...
Read more >
Using character escapes in markup and CSS - W3C
Character escapes are a way of writing a character in markup using only ASCII code points. They are useful if you are unable...
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