用电报b发送不同字体的信息

2024-05-17 03:44:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用框架python telegram bot创建一个telegram bot!

现在,bot必须用一种特殊的字体发送消息,这意味着bot用不同的漂亮字体发送消息,一种不同于电报字体的字体。

我该怎么办???


Tags: 框架消息bot字体电报telegram
2条回答

没有人(甚至你这个官员)可以用不同的字体/颜色发送消息,你可以向@Telegram提出建议,他们会考虑将此作为功能添加。

消息文本中的formatting options有限,您可能会喜欢它。

唯一可以使用的颜色是红色或将背景颜色设置为灰色。

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

然后在sendMessage函数中,需要添加参数parse_mode并将其设置为“Markdown”

相关问题 更多 >