admin管理员组文章数量:1405565
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")
本文标签: pythonAiogram message formattingStack Overflow
版权声明:本文标题:python - Aiogram message formatting - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744253314a2597353.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论