-1

I want to create a Telegram Messenger bot with framework python-telegram-bot!

Now, the bot must send a message with a specific font. This means the bot sends a message with a different and beautiful font - a font different from the Telegram Messenger font.

How can I do it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sajjad
  • 41
  • 1
  • 4
  • 13

3 Answers3

2

No one (even you the official) can send messages in a different font/color, but you can make a suggestion to @Telegram. They will consider adding this as a feature.

There have limited formatting options in the message text, and you might like it.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sean Wei
  • 7,433
  • 1
  • 19
  • 39
0

These HTML tags are currently supported by Telegram:

https://core.telegram.org/bots/api#formatting-options

<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
<u>underline</u>, <ins>underline</ins>
<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
<b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
<a href="http://www.example.com/">inline URL</a>
<a href="tg://user?id=123456789">inline mention of a user</a>
<code>inline fixed-width code</code>
<pre>pre-formatted fixed-width code block</pre>
<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
amir22
  • 413
  • 6
  • 14
-1

The only color that you can use is red or set the background color to gray.

str = "`Hello`"     #this will turn the text red on Telegram.
str = "```Hello```" #this will turn the background color gray of the text on Telegram

Then at the sendMessage function, you need to add the parameter parse_mode and set it to "Markdown".

Miguel Guerra
  • 145
  • 1
  • 8