Answer the question
In order to leave comments, you need to log in
How to make bold font in Telegram bot?
Hello! You need to make sure that in one message the bot uses both regular and bold fonts. I read the documentation, but did not quite understand how to apply it in practice, more precisely, specifically in my case. Here is an example of my Python code
import telebot
from telebot.types import Message
@bot.message_handler(commands=['start'])
def start_handler(message):
bot.send_message(message.chat.id, 'Привет, я бот' + '\n' + 'Здесь должен быть жирный шрифт')
Answer the question
In order to leave comments, you need to log in
Here is a code snippet for example:
def test_send_message_with_markdown(self):
tb = telebot.TeleBot(TOKEN)
markdown = """
*bold text*
_italic text_
[text](URL)
"""
ret_msg = tb.send_message(CHAT_ID, markdown, parse_mode="Markdown")
assert ret_msg.message_id
bot.send_message(CHAT_ID, "*Здесь должен быть жирный шрифт*", parse_mode= "Markdown")
It's a compromise, you decide. If there is not much data, load everything and filter. If there is a lot, then load in portions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question