【问题标题】:How can I "press enter" or go to the next line in an embed?如何“按 Enter”或转到嵌入中的下一行?
【发布时间】:2021-01-09 23:51:04
【问题描述】:

所以我正在制作我的帮助页面,我想列出所有命令及其描述。当我尝试将每个命令及其描述放入不同的“”中,然后每次都下一行。它没有用。以下是我的尝试,感谢任何帮助:

async def currency(ctx):
    await open_account(ctx.author)

    em = discord.Embed(title = f":moneybag: Currency Commands",color = discord.Color.green())
    em.add_field(name = "Free",value = "`cook` - Cook some cookies and sell them"
    "`beg` - Beg and get coins"
    "`farm` - Farm *cough cough* and sell the production for coins"
    "`daily` - Get 2500 coins every day"
    "`balance` - Shows you the amount of money you have")
    em.add_field(name = ":star: Premium",value = "Coming Soon")
    await ctx.send(embed = em)```

【问题讨论】:

  • 只需在字符串中执行 \n 它会创建一个新行

标签: discord discord.py


【解决方案1】:

要在字符串中向下一行,我们可以简单地在其中添加\n。 快速示例:(我对 discord.py 不熟悉,所以请记住 .setDescription() 是一个 discord.js 嵌入函数)

.setDescription('hello!\nI\nlike\ntomatoes\n!!!');

预期的结果应该是描述显示的嵌入:

hello!
I
like
tomatoes
!!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-11-12
    • 2016-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多