python-3.x - How to use markdown in discord.py?
问题描述
I tried to do it like this:
await message.channel.send("**" + current_text + "**")
But it doesn't work. It will show the result like this:
** Hey **
解决方案
为此,我强烈建议使用F-Strings。F-Strings 允许您直接从字符串中调用变量。这对您来说应该更容易实现降价,因为您可以这样做f"**{current_text}**"
并且{current_text}
将被相应的变量替换。
推荐阅读
- scala - Scala XML 文字 - 布尔值与字符串
- json - Swift 4 JSON 解析(预期解码数组
但找到了一本字典) - javascript - 将数据从一个渲染的模板复制到一个新的模态中
- c++ - 如何创建与 OpenSSL C++ 输出相比的 OpenSSL 输出以生成单元测试?
- playframework - sbt 测试单个目录
- android - 从 React Native Fragment 后按更新 Android Activity 的 ActionBar 标题
- netsuite - 如何将支持案例附加到销售订单?
- mysql - MySQL - Left Join 耗时太长,如何优化查询?
- python - 使用 pandas 数据框计算行数
- python-3.x - 如何在 python 中使用 ruamel 库为数组添加新元素?