How to make a Discord embed with only 2 columns
Asked Answered
M

2

7

I am trying to make an embed with only 2 columns. Whenever I delete the inline value it drops test3 field like I want. Then I keep inline: true on test4 field and it drops to another row. I tried making both test3 and test4 inline values false but the problem still exists. How can I correct this?

Update: After playing with it some more I found that when I make a 5th field it splits the column again. Is there anyway I can hide test3 but keep the field?

My embed looks like this

enter image description here

My Code:

command(client, 'test' , (message) => {

      const embed = new Discord.MessageEmbed()
     
         .setTitle('Test')
         .setColor('#C69B6D')
         .addFields(  
           {
              name: 'test1' ,
              value: "```TESTING```",
              inline: true,
            },
            {
               name: 'test2' ,
               value: "```TESTING```",
               inline: true,
             },
             {
               name: 'test3' ,
               value: "```TESTING```",
               
             },
             {
               name: 'test4' ,
               value: "```TESTING```",
               inline: true,
             },

         )
      


      message.channel.send(embed).then(msg => {})
 
   })

Updated Embed:

enter image description here

My Updated Code:

   command(client, 'test' , (message) => {

      const embed = new Discord.MessageEmbed()
     
         .setTitle('Test')
         .setColor('#C69B6D')
         .addFields(  
           {
              name: 'test1' ,
              value: "```TESTING```",
              inline: true,
            },
            {
               name: 'test2' ,
               value: "```TESTING```",
               inline: true,
             },
             {
               
               
             },
             {
               name: 'test4' ,
               value: "```TESTING```",
               inline: true,
             },
             {
               name: 'test5' ,
               value: "```TESTING```",
               inline: true,
             },

         )
      


      message.channel.send(embed).then(msg => {})
 
   })
Missive answered 5/3, 2021 at 1:5 Comment(1)
Have you tried a generator for your needs? Many available to do the boring work for you. Embeds work tricky too, if you create one and try to modify it with different columns/etc it will likely fail. You may need to implement a trick like HelpBoxEmbed, UserEmbed, SearchEmbed.Wilcox
D
12

You can use .addField('\u200b', '\u200b') to add an empty field

See the discord.js guide for more information

Disject answered 5/3, 2021 at 5:5 Comment(1)
I came in here looking for a way to add many fields to an embed message from a for-loop but to be displayed in two columns but it seems there isn't any. Your answer is though a good way to add one or two extra empty fields in case the list is not multiple of three (list.length % 3 !==0).Throe
F
2

Use '\t' escaped symbol instead of '\u200b' or '\b':

.addFields(  
           {
              name: 'test1' ,
              value: "```TESTING```",
              inline: true,
            },
            {
               name: 'test2' ,
               value: "```TESTING```",
               inline: true,
             },
             {
               name: "\t",
               value: "\t"
             },
             {
               name: 'test4' ,
               value: "```TESTING```",
               inline: true,
             },
             {
               name: 'test5' ,
               value: "```TESTING```",
               inline: true,
             },

         )

Discord embed example

Fakery answered 14/2, 2024 at 4:51 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.