I have the following discord embed:
message.reply({
content: '',
embed: {
color: 11416728,
author: {
name: 'xx know-it-all',
icon_url: ''
},
description: '',
footer: {
icon_url: client.user.avatarURL,
text: '© xx Network'
},
fields: [
{
name: '1st Line',
value: '2nd Line',
},
{
name: 'MAKE THIS JUST A SPACER',
value: 'MAKE THIS JUST A SPACER',
},
{
name: '5th Line',
value: '6th Line',
}
]
}
})
I am trying to figure out how to create a spacer of sorts. I have tried using a html space, blank space, and alt code space. None of them seem to work. Any ideas on how to accomplish this?
The issue is discord is returning the field as null, so it's not taking it when I use the invisible html space or putting \n
I have the following discord embed:
message.reply({
content: '',
embed: {
color: 11416728,
author: {
name: 'xx know-it-all',
icon_url: 'https://xx.png'
},
description: '',
footer: {
icon_url: client.user.avatarURL,
text: '© xx Network'
},
fields: [
{
name: '1st Line',
value: '2nd Line',
},
{
name: 'MAKE THIS JUST A SPACER',
value: 'MAKE THIS JUST A SPACER',
},
{
name: '5th Line',
value: '6th Line',
}
]
}
})
I am trying to figure out how to create a spacer of sorts. I have tried using a html space, blank space, and alt code space. None of them seem to work. Any ideas on how to accomplish this?
The issue is discord is returning the field as null, so it's not taking it when I use the invisible html space or putting \n
Share Improve this question edited May 16, 2018 at 15:11 Andrew Rayner asked May 16, 2018 at 14:02 Andrew RaynerAndrew Rayner 1,0641 gold badge6 silver badges22 bronze badges 4- Where are you trying to use the break? – André Commented May 16, 2018 at 14:49
- Here: name: '...',. I get value can't be null – Andrew Rayner Commented May 16, 2018 at 14:50
- Don't think you can use line breaks on that field. Try _ \n _ without the spaces – André Commented May 16, 2018 at 14:51
- Wait, you want a line separator/break or give it more space, like a few pixels of margin? – André Commented May 16, 2018 at 14:52
3 Answers
Reset to default 11I got it!
All I needed to do was use the C/C++/Java encoding version of the invisible space
\u200B
Reference: https://www.fileformat.info/info/unicode/char/200B/index.htm
This can come into use for other people looking to make embeds look more clear as discord complicates it
Discord.JS has a method .addEmptyField()
that uses \u200B
to display a empty line.
message.reply({
content: '',
embed: {
color: 11416728,
author: {
name: 'xx know-it-all',
icon_url: 'https://xx.png'
},
description: '',
footer: {
icon_url: client.user.avatarURL,
text: '© xx Network'
},
fields: [
{
name: '1st Line',
value: '2nd Line',
},
{
name: '\u200B',
value: '\u200B',
},
{
name: '5th Line',
value: '6th Line',
}
]
}
})
Appears to be working here.
Interestingly, I figured out you can get around this by using the backspace escape-sequence too:
\b
This is useful if you want your embed fields formatted in a 2 x 2:
fields: [
{
name: 'Field1',
value: 'Value1',
inline: true
},
{
name: 'Field2',
value: 'Value2',
inline: true
},
{
name: '\b',
value: '\b',
inline: true
},
{
name: 'Field3',
value: 'Value3',
inline: true
},
{
name: 'Field4',
value: 'Value4',
inline: true
},
]