What is the proper way to use slash commands

I have seen many ways u can use slash commands but I want to know the most flexible and easiest way
12 Replies
d.js toolkit
d.js toolkit14mo 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! - Marked as resolved by OP
treble/luna
treble/luna14mo ago
wdym? how you use them is up to you
! MYA
! MYAOP14mo ago
oh alr also
client.on("messageCreate", (msg) => {
if (msg.content === "lol") {
const embed = new Discord.EmbedBuilder()
.setTitle("lols")
msg.reply({embeds: embed})
}
});
client.on("messageCreate", (msg) => {
if (msg.content === "lol") {
const embed = new Discord.EmbedBuilder()
.setTitle("lols")
msg.reply({embeds: embed})
}
});
the error this throws links to file that is not the one im working on I think it may be something wrong with D.js itself or im doing smthn wrong idk
treble/luna
treble/luna14mo ago
that is not a slash command
! MYA
! MYAOP14mo ago
I know This is a seperate issue
treble/luna
treble/luna14mo ago
and the embeds expects an array
! MYA
! MYAOP14mo ago
so an array inside the EmbedBuilder() constructer?
treble/luna
treble/luna14mo ago
no when sending your message
d.js docs
d.js docs14mo ago
interface MessageCreateOptions The options for sending a message.
! MYA
! MYAOP14mo ago
yeee i figured it outt using GPT lesss go
client.on('messageCreate', (msg) => {
if (msg.content === 'lol') {
const embed = {
title: 'lols',
};

msg.reply({ embeds: [embed] });
}
});
client.on('messageCreate', (msg) => {
if (msg.content === 'lol') {
const embed = {
title: 'lols',
};

msg.reply({ embeds: [embed] });
}
});
treble/luna
treble/luna14mo ago
please dont ever use chatgpr You shouldn't code if you cant fix your own code Nor is gpt up to date and by removing the builder you're just making it overcomplicated
! MYA
! MYAOP14mo ago
ok im sorry ill figure it out oh yh nvm I figured it out
Want results from more Discord servers?
Add your server