#Hey problem w my embed

22 messages · Page 1 of 1 (latest)

pallid kraken
#

i have a problem w my embed, the command dosnt work at all, if anyone know why it would be great to help me a little bit. Im sorry if i take a long time to answer, im working and doing others stuff by side!

thats the entire code here :

frosty nestBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
pallid kraken
#
const Discord = require('discord.js');


const prefix = '!';
const cooldownTime = 60000;


const cooldowns = new Discord.Collection();

function sendEmbedToChannel(message) {
    if (message.author.bot) return;
    if (!message.content.startsWith(prefix)) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();

    if (command === 'classes') {
        if (cooldowns.has(message.author.id)) {
            const remainingTime = cooldownTime - (Date.now() - cooldowns.get(message.author.id));
            message.channel.send(`La commande est en cooldown. Veuillez attendre ${remainingTime / 1000} secondes avant de renvoyer la commande.`);
            return;
        }

        cooldowns.set(message.author.id, Date.now());
        setTimeout(() => cooldowns.delete(message.author.id), cooldownTime);

        const embed = new Discord.MessageEmbed()
            .setColor('#0099ff')
            .setTitle('Titre de l\'embed')
            .setDescription('Description de l\'embed')
            .addField('Champ 1', 'Contenu du champ 1', true)
            .addField('Champ 2', 'Contenu du champ 2', true)
            .addField('Champ 3', 'Contenu du champ 3')
            .setTimestamp()
            .setFooter('Texte du pied de page', 'URL de l\'image du pied de page');

        message.channel.send(embed);
    }
}

module.exports = {
    sendEmbedToChannel,
    prefix,
    cooldownTime,
};```
#

idk if you need anything else

#

when i press the command like this

#

it dosnt show me any error

next wasp
#

Is this V13?

#

Its EmbedBuilder not MessageEmbed also you need to require it from discord.js

kindred solstice
pallid kraken
#

okay mb i followed an old guide im dumb

#

i found the way on the guide but wait

pallid kraken
#

got a pb w my embed again :>

#

thats the code

#

i got an error

vagrant cypress
pallid kraken
#

mb

pallid kraken
ocean crag
next wasp
#

Command name use lowercase

#

Also its const myEmbed = new EmbedBuilder()