Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
56
rated 0 times [  62] [ 6]  / answers: 1 / hits: 9655  / 4 Years ago, sun, august 23, 2020, 12:00:00

I'm kinda new to coding discord bots using discord.js and I was wondering if I could format the text in embeds. I can't find the way of doing it, as I have the value of the field in between these symbols ´ to make it possible to go on multiple lines and I would like the text to be code formatted (example in the attachment).


My code looks like this and I would like for example the "line 1" text to be the code format:


execute(message, args){
const embed = new Discord.MessageEmbed()
.setTitle('Commands list')
.setColor('#DAF7A6')
.addFields(
{name: 'Test 1',
value:`line 1
line 2
line 3`}
)
message.channel.send(embed);
}

Thanks :) enter


More From » discord

 Answers
2

Use double ". Like: "`Your name`".


If you want to have multiple lines, use n, it's the markdown alias for the back to line stuff.


So in your example:


execute(message, args){
const embed = new Discord.MessageEmbed()
.setTitle('Commands list')
.setColor('#DAF7A6')
.addFields(
{name: 'Test 1',
value:"`line 1`n`line 2`n`line 3`"}
)
message.channel.send(embed);
}

[#2819] Thursday, August 20, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarod

Total Points: 62
Total Questions: 111
Total Answers: 83

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
jarod questions
;