1

It is necessary to have the message sent to Embed (so it could be the specified parameters (color, author, title, description, addField, content message) Example: https://embedbuilder.nadekobot.me/

const arg = message.content.slice().trim().split(/ +/g);

let name = arg[1];
if (!name) return message.channel.send(channelEmbed);
let anonce = args.slice(1).join();
if(!anonce) return message.channel.send(anonceEmbed);

let anoncechannel = message.guild.channels.find(`name`, name);

anoncechannel.sendEmbed(anonce)
1
  • Also .sendEmbed() is deprecated. You should only use .send()
    – André
    Apr 17, 2018 at 19:57

1 Answer 1

0

Take a look at RichEmbeds.
You can build a new RichEmbed and then send it to the channel you want. You can set every value, title, description, color, footer..
Example:

const exampleEmbed = new Discord.RichEmbed()
    .setColor('#0099ff')
    .setTitle('Some title')
    .setURL('https://discord.js.org/')
    .setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
    .setDescription('Some description here')
    .setThumbnail('https://i.imgur.com/wSTFkRM.png')
    .addField('Regular field title', 'Some value here')
    .addField('Inline field title', 'Some value here', true)
    .addField('Inline field title', 'Some value here', true)
    .addField('Inline field title', 'Some value here', true)
    .setImage('https://i.imgur.com/wSTFkRM.png')
    .setTimestamp()
    .setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');

message.channel.send({ embed: exampleEmbed });

source: discordjs.guide

This would be the output:
enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.