Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

discord - How can I "press enter" or go to the next line in an embed?

So I'm making my help page and I want to list all of the commands and their description. When I tried putting every command and its description into different "" and then going down a line every time. It didn't work. Here's how I tried, any help is appreciated:

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)```
question from:https://stackoverflow.com/questions/65644071/how-can-i-press-enter-or-go-to-the-next-line-in-an-embed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To go down a line in a string, we can simply add inside of it. Quick example: (I'm not familiar with discord.py so kee in mind .setDescription() is a discord.js Embed function)

.setDescription('hello!
I
like
tomatoes
!!!');

The expected outcome should be an embed who's description displays:

hello!
I
like
tomatoes
!!!

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...