问题
I am writing a telegram bot in python. I want to print messages with bold letters. I tried to use * and **, but it does not help. Is there a function for formatting or a way to do it?
回答1:
You should use:
bot.send_message(chat_id=chat_id, text="*bold* Example message",
parse_mode=telegram.ParseMode.MARKDOWN)
Or:
bot.send_message(chat_id=chat_id, text='<b>Example message</b>',
parse_mode=telegram.ParseMode.HTML)
More info at: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Code-snippets#message-formatting-bold-italic-code-
来源:https://stackoverflow.com/questions/49327296/how-can-i-write-bold-in-python-telegram-bot