#Hey problem w my embed
22 messages · Page 1 of 1 (latest)
- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - 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!
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
Is this V13?
Its EmbedBuilder not MessageEmbed also you need to require it from discord.js
Press the command like what? You export a function, where do you import and call that function?
A slash command name must be lowercase
mb
i still dont see the command on my /
It can't be deployed with an invalid name, so of course it's not showing in the app
Check your project for a command with the name "Embed"
Require EmbedBuilder from discord js
Command name use lowercase
Also its const myEmbed = new EmbedBuilder()