close

How should I use parse_mode=’HTML’ in telegram python bot?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How should I use parse_mode=’HTML’ in telegram python bot in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How should I use parse_mode=’HTML’ in telegram python bot?

  1. How should I use parse_mode='HTML' in telegram python bot?

    Of course, you must use your own telegram token and channel id. Also notice I'm using parse_mode='html' # lowercase

  2. I use parse_mode='HTML' in telegram python bot

    Of course, you must use your own telegram token and channel id. Also notice I'm using parse_mode='html' # lowercase

Method 1

It works for me! Here’s the code I’m using:

>>> from telegram import Bot
>>> tkn = '88888:199939393'; chid = '-31828'
>>> bot = Bot(tkn)
>>> with open('ye.jpeg', 'rb') as fme:
...   bot.send_photo(chid, fme, caption='<b>Hallo</b>', parse_mode='html')
...
<telegram.message.Message object at 0x7f6301b44d10>

Of course, you must use your own telegram token and channel id. Also notice I’m using parse_mode='html' # lowercase

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read