Hey problem w my embed

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 :
12 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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!
s a k a  t a
s a k a t aOP16mo ago
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,
};
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
Cae
Cae16mo ago
Is this V13? Its EmbedBuilder not MessageEmbed also you need to require it from discord.js
s a k a  t a
s a k a t aOP16mo ago
okay mb i followed an old guide im dumb i found the way on the guide but wait got a pb w my embed again :>
s a k a  t a
s a k a t aOP16mo ago
thats the code
s a k a  t a
s a k a t aOP16mo ago
i got an error
s a k a  t a
s a k a t aOP16mo ago
Shuttle
Shuttle16mo ago
A slash command name must be lowercase
s a k a  t a
s a k a t aOP16mo ago
mb i still dont see the command on my /
Squid
Squid16mo ago
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"
Cae
Cae16mo ago
Require EmbedBuilder from discord js Command name use lowercase Also its const myEmbed = new EmbedBuilder()
Shuttle
Shuttle16mo ago
using EmbedBuilder is not mandatory
Want results from more Discord servers?
Add your server