Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send a colored text message?

I am trying to send a colored text message to a user as reply, using sendMessage with HTML parsing.

bot.sendMessage(update.message.chat_id, "<span style=\"color:blue\">foo</span>", telegram.ParseMode.HTML)

Sending <span style="color:blue">foo</span> doesn't work, as span is not supported:

Bad Request: Can't parse message text: Unsupported start tag "span" at byte offset 0 (400)

I am using the python-telegram-bot v. 4.0.3.

Is there another way?

like image 806
Rakete1111 Avatar asked May 07 '16 19:05

Rakete1111


People also ask

How do you color your text in text?

Select the text that you want to change. On the Home tab, in the Font group, choose the arrow next to Font Color, and then select a color.

How do you change color of text messages?

Select Accessibility from the list of options. Under the heading, Display, select Text and display. This option may also be called Color and motion. Select Color Inversion from the list of options.

Can I change the color of my text messages on my Iphone?

To change iMessage color using the Color Text Bubbles app: Launch the Messages app. Click on an existing conversation or click the New Message icon to start a new chat. Tap and hold on the row of apps just above the keyboard. Still touching the screen, swipe to the left until you see the Color Text Bubble app.

How do you color your text on a phone?

Using The Themes OptionGo to the Settings app. Find and tap on the Wallpapers and Themes option from the given choices. Go to Themes and select your desired theme. Based on the theme you choose, Android will change your font color.


2 Answers

Unfortunately there is no documentation about the tag accepted by the bot, except the unit test for parsemode.

The tags that work are b, i, a for bold, italic and link elements, this is what is offered, maybe there's more but I couldn't find it in the docs

like image 107
edoput Avatar answered Oct 04 '22 10:10

edoput


Your can enlight piece of text with grave character "`"

AAAA ` enlight piece ` BBB

like image 29
veaceslav.kunitki Avatar answered Oct 04 '22 12:10

veaceslav.kunitki