Search code examples
pythonpython-3.xtelegram-bottelepot

How can I bold text in telepot Telegram bot?


I have tried this

elif command == 'bold':
    telegram_bot.sendMessage (chat_id, str("*bold*"), reply_markup=markup)

But it is replying *bold* instead of bold


Solution

  • You need to provide a parse_mode Parameter (parse_mode="Markdown").

    Or else you will not see any markdown style.

    sendMessage(chat_id, "*this text is bold*", parse_mode= 'Markdown') 
    

    See

    https://telepot.readthedocs.io/en/latest/reference.html#telepot.Bot.sendMessage