You seem to be confused as to how to create embeds.
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.on("message", async (msg) => {
const exampleEmbed = new Discord.MessageEmbed() //embeds are part of the `Discord` object defined above
.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')
.addFields(
{ name: 'Regular field title', 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 },
)
.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');
//send embed
message.channel.send(exampleEmbed);
}
Be sure to check out the docs, I included your on message
statement to make it slightly easier to understand also.
Using the code you provided:
if (args[0].toLowerCase() === "sayembed") {
const embed = new Discord.MessageEmbed() //added 'Discord'
.setDescription(args.slice(1).join(" "))
.setColor("RANDOM")
message.channel.send(embed);
}
0
solved Cannot turn into embed [closed]