首页 > 解决方案 > 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 **

标签: python-3.xdiscord.py

解决方案


为此,我强烈建议使用F-Strings。F-Strings 允许您直接从字符串中调用变量。这对您来说应该更容易实现降价,因为您可以这样做f"**{current_text}**"并且{current_text}将被相应的变量替换。


推荐阅读