Sapphire - Imagine a framework
Sapphire - Imagine a framework

sapphire-support

Root Question Message

Evax The Fox
Evax The Fox12/11/2022
How do i delete a slash command?

I Accidentally Created A Slash Command. how do i remove it?
<3 execrate
<3 execrate12/11/2022
Use discordjs like that
Evax The Fox
Evax The Fox12/11/2022
import discordjs then remove it...?
<3 execrate
<3 execrate12/11/2022
<3 execrate
<3 execrate12/11/2022
With sapphire you can't
Evax The Fox
Evax The Fox12/11/2022
can you remove only 1 slash command?
<3 execrate
<3 execrate12/11/2022
When you use body: [], you remove the all slash command
<3 execrate
<3 execrate12/11/2022
I think you can, I power on my computer
<3 execrate
<3 execrate12/11/2022
Wait
Evax The Fox
Evax The Fox12/11/2022
okie then
Evax The Fox
Evax The Fox12/11/2022
and
Evax The Fox
Evax The Fox12/11/2022
does sapphire have discordjs included or do i have to import it myself?
Lioness100
Lioness10012/11/2022
You'd have to import it yourself
Evax The Fox
Evax The Fox12/11/2022
okayie then

Solution Message

Lioness100
Lioness10012/11/2022
Evax The Fox
Evax The Fox12/11/2022
uhhhhh
Lioness100
Lioness10012/11/2022
It's a GUI so you can manage your commands online
Evax The Fox
Evax The Fox12/11/2022
oh okay'
<3 execrate
<3 execrate12/11/2022
No, import it yourself
Evax The Fox
Evax The Fox12/11/2022
okayie
<3 execrate
<3 execrate12/11/2022
Amazing
Evax The Fox
Evax The Fox12/11/2022
i dont know which message to set as solved
Evax The Fox
Evax The Fox12/11/2022
this or
<3 execrate
<3 execrate12/11/2022
His message
Evax The Fox
Evax The Fox12/11/2022
this...?
<3 execrate
<3 execrate12/11/2022
No
Evax The Fox
Evax The Fox12/11/2022
okay then, thanks for your helps!
<3 execrate
<3 execrate12/11/2022
@381490382183333899's message
Evax The Fox
Evax The Fox12/11/2022
done it
Evax The Fox
Evax The Fox12/11/2022
const { Command } = require('@sapphire/framework');
class PingCommand extends Command {
  constructor(context, options) {
    super(context, { ...options });
  }
  registerApplicationCommands(registry) {
    registry.registerChatInputCommand((builder) =>
      builder.setName('ping').setDescription('Ping bot to see if it is alive')
    );
  }
}
module.exports = {
  PingCommand
};
Evax The Fox
Evax The Fox12/11/2022
hmm yes
Evax The Fox
Evax The Fox12/11/2022
removes it without needing token
Evax The Fox
Evax The Fox12/11/2022
adds*
Evax The Fox
Evax The Fox12/11/2022
why am i using htis
Evax The Fox
Evax The Fox12/11/2022
i should use the tool you gave me
<3 execrate
<3 execrate12/11/2022
like that
<3 execrate
<3 execrate12/11/2022
 client.application.commands.fetch('123456789012345678') // id of your command
      .then( (command) => {
    console.log(`Fetched command ${command.name}`)
    // further delete it like so:
    command.delete()
    console.log(`Deleted command ${command.name}`)
    }).catch(console.error);
Evax The Fox
Evax The Fox12/11/2022
okay
Evax The Fox
Evax The Fox12/11/2022
again. thanks for all your helps. i dont know how much to thank you 2 tbh
Evax The Fox
Evax The Fox12/11/2022
god im making alot of text mistakes
Lioness100
Lioness10012/11/2022
Lol np
Lioness100
Lioness10012/11/2022
Btw you can just do client.application.commands.delete and skip the fetch middleman
Evax The Fox
Evax The Fox12/11/2022
fetch just checks if the command exists right?
<3 execrate
<3 execrate12/11/2022
@381490382183333899 every commands are fetch on login ?
<3 execrate
<3 execrate12/11/2022
it resolve it
Lioness100
Lioness10012/11/2022
Yeah, and gives you an object representation of it
Lioness100
Lioness10012/11/2022
Idk, but it doesn't have to be fetched as long as you have the ID
<3 execrate
<3 execrate12/11/2022
@381490382183333899 it's not fetch by default
console.log(client.application.commands.cache);
Collection(0) [Map] {}
Evax The Fox
Evax The Fox12/11/2022
and.. is there a way to send a ephermal message when... a subcomand is r-ran?
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy