I'm developing a telegram bot on aiogram and faced a problem. I need to highlight the text bold italicized in the MD V1. How do I do it? I tried different formats: triple underline, triple asterisks, asterisk underline. Nothing helped.
I'm developing a telegram bot on aiogram and faced a problem. I need to highlight the text bold italicized in the MD V1. How do I do it? I tried different formats: triple underline, triple asterisks, asterisk underline. Nothing helped.
Share Improve this question edited Mar 24 at 16:34 AsfhtgkDavid asked Mar 24 at 12:12 AsfhtgkDavidAsfhtgkDavid 499 bronze badges 4- Please show us the code you've tried – 0stone0 Commented Mar 24 at 12:14
- I don't know if it makes sense. It's just reading a message from a .md file and sending it. – AsfhtgkDavid Commented Mar 24 at 12:25
- Well it's hard for us to guess whats wrong if you don't show the code – 0stone0 Commented Mar 24 at 12:38
- @0stone0 , I don't think there's a problem with the code. The problem is that I don't know how to make bold italics in Telegram MD syntax. – AsfhtgkDavid Commented Mar 24 at 15:02
1 Answer
Reset to default 0For MarkdownV2
, you need *foo*
for bold, _bar_
for italic and you can combine them like so:
*_combined _*
Test message:
*bold*
_italic_
*_combined_*
Results in:
If you want to use the AioGram classes, use:
aiogram.utils.formatting.Underline
aiogram.utils.formatting.Bold
from aiogram.utils.formatting import (
Bold
)
msg = Bold("Foo Bar")