Answer the question
In order to leave comments, you need to log in
How to use escaping in aiogram?
How to escape text in aiogram to feed it to markdown?
That is, there is a code:
import config
from aiogram import Bot, Dispatcher, executor, types
from aiogram.utils.markdown import escape_md
bot = Bot(token=config.token)
dp = Dispatcher(bot)
@dp.message_handler()
async def text_messages(message: types.Message):
text = escape_md(message.text)
await message.answer(text, parse_mode=types.ParseMode.MARKDOWN)
#Мое сообщение
Привет. Как дела?
#Ответ бота
Привет\. Как дела?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question