Closed lzrdblzzrd closed 3 years ago
Changing parse_mode
in bot.py
from Markdown
to MarkdownV2
gave this result:
C:\ASFBot-master>python bot.py --token token --alias alias --host host --port 1242 --password ipc_password
2020-12-29 17:13:34,864 - ASFBot - INFO - Starting up bot...
2020-12-29 17:13:34,926 - ASFBot - INFO - ASF Instance replied: OK
2020-12-29 16:51:00,497 - ASFBot - INFO - Command: !status. Response: <bot> The bot doesn't farm anything.
2020-12-29 17:13:38,390 (__init__.py:489 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '>' is reserved and must be escaped with the preceding '\'"
Changing to HTML
gave:
C:\ASFBot-master>python bot.py --token token --alias alias --host host --port 1242 --password ipc_password
2020-12-29 17:15:26,908 - ASFBot - INFO - Starting up bot...
2020-12-29 17:15:26,969 - ASFBot - INFO - ASF Instance replied: OK
2020-12-29 16:51:00,497 - ASFBot - INFO - Command: !status. Response: <bot> The bot doesn't farm anything.
2020-12-29 17:15:30,862 (__init__.py:489 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "bot" at byte offset 0"
P.S. Bot commands on the ASF side are executed. The problem is that the bot in Telegram does not send feedback.
Complete removal , parse_mode= "Markdown"
from every function in bot.py
fixed the problem.
For example
from
bot.reply_to(message, "Invalid command. Usage:\n`/status <bot>`", parse_mode="Markdown")
to
bot.reply_to(message, "Invalid command. Usage:\n`/status <bot>`")
Let me know if deleting parse_mode
somehow messes up some bot replies.
As I noticed, deleting parse_mode
creates formatting errors, but only if you use /command
instead of !command
. So it would be nice if you fixed this bug.
Hi, thanks for the debugging. markdown parse mode should be refactored into html markdown which is way less problematic. I'll look into it
@lzrdblzzrd I just pushed to the develop branch the changes that should solve this problem. Please check them out and report back any issues you may encounter!
I checked the bot's work with HTML formatting and didn't find any problems. Thanks.
Cool, I'll merge into master then. Thank you!