python - 如何在 Telepot Telegram 机器人中加粗文本?
问题描述
我试过这个
elif command == 'bold':
telegram_bot.sendMessage (chat_id, str("*bold*"), reply_markup=markup)
但它正在回复*bold*
而不是粗体
解决方案
您需要提供一个parse_mode
参数 (parse_mode="Markdown")。
否则您将看不到任何降价样式。
sendMessage(chat_id, "*this text is bold*", parse_mode= 'Markdown')
看
https://telepot.readthedocs.io/en/latest/reference.html#telepot.Bot.sendMessage
推荐阅读
- android - 何设置 MPAndroid 饼图无标签
- ada - 如何在 Ada 的嵌套聚合中分配记录
- karate - KARATE - 如何从响应中获取数据/通过运行另一个功能文件
- saml - 如何将 Auth0 作为 IdP 添加到 ADFS?
- docker - docker stack 中的网络未定义问题
- php - Remote debugging server 2008, PHP, IIS, Xdebug
- django-models - 动态添加字段到 drf 序列化程序
- ag-grid - AG-Grid - Apply Style to Whole Column Dynamically?
- apache - Apache proxy follow redirect without going back to the browser
- ios - UITableView loads all the pages of API once