Stav_xd
Stav_xd

Reputation: 1

How can I get the embed field title and value in the same line

I am trying to create an embed using my discord bot, but unfortunately, I don't know how to make the title of a field be in the same line as its value

This is my code so far:

const Discord = require('discord.js');

const client = new Discord.Client()

client.on('ready', () => {
    console.log('Ready!');
});

client.on("message", message => {
    if(message.content === "hy!help") {
        const exampleEmbed = new Discord.MessageEmbed()
            .setColor('#ff0000')
            .setTitle('`General Rules`')
            .setThumbnail('https://cdn.discordapp.com/attachments/833945466550878246/838524255057608734/1619990134900.png')
            .addFields(
                { name: '`1`', value:'Some value here' },
                { name: '\u200B', value: '\u200B' },
                { name: 'Inline field title', value: 'Some value here', inline: true },
                { name: 'Inline field title', value: 'Some value here', inline: true },
            )
            .setFooter('© By Cowboy RolePlay', 'https://cdn.discordapp.com/attachments/833945466550878246/838524255057608734/1619990134900.png');
    message.channel.send(exampleEmbed);
        }  } )
client.login('token')

Upvotes: 0

Views: 936

Answers (1)

anzepintar
anzepintar

Reputation: 126

I think that this is not possible, because discord does not allow name and value in the same line. Fields are basically columns (max number of these columns is 3 1) You can do this with .setDescription 2:

client.on("message", message => {
if(message.content === "hy!help") {
    const exampleEmbed = new Discord.MessageEmbed()
        .setColor('#ff0000')
        .setTitle('`General Rules`')
        .setThumbnail('https://cdn.discordapp.com/attachments/833945466550878246/838524255057608734/1619990134900.png')
        .setDescription('**Name:** value \n **Name:** value \n **Name:** value '
        .setFooter('© By Cowboy RolePlay', 'https://cdn.discordapp.com/attachments/833945466550878246/838524255057608734/1619990134900.png');
message.channel.send(exampleEmbed);
    }

Upvotes: 2

Related Questions