#How do i delete a slash command?

1 messages · Page 1 of 1 (latest)

spring osprey
#

I Accidentally Created A Slash Command. how do i remove it?

onyx badgeBOT
#

@spring osprey to help others find answers, you can mark your question as solved via Right Click Solution Message->Apps->✅ Mark Solution

outer flax
#

Use discordjs like that

spring osprey
#

import discordjs then remove it...?

outer flax
#

With sapphire you can't

spring osprey
#

can you remove only 1 slash command?

outer flax
#

When you use body: [], you remove the all slash command

outer flax
#

Wait

spring osprey
#

okie then

#

and

#

does sapphire have discordjs included or do i have to import it myself?

ivory urchin
#

You'd have to import it yourself

spring osprey
ivory urchin
ivory urchin
#

It's a GUI so you can manage your commands online

spring osprey
#

oh okay'

outer flax
#

No, import it yourself

spring osprey
#

okayie

spring osprey
#

i dont know which message to set as solved

outer flax
#

His message

spring osprey
outer flax
#

No

spring osprey
#

okay then, thanks for your helps!

onyx badgeBOT
#

Thank you for marking this question as solved!

Question Message ID

1051476027500675174

Solution Message ID

1051477771471290398

outer flax
#

@ivory urchin's message

spring osprey
#

done it

#
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
};
#

hmm yes

#

removes it without needing token

#

adds*

spring osprey
#

i should use the tool you gave me

outer flax
#

like that

#
 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);```
spring osprey
#

okay

#

again. thanks for all your helps. i dont know how much to thank you 2 tbh

#

god im making alot of text mistakes

ivory urchin
#

Lol np

ivory urchin
spring osprey
#

fetch just checks if the command exists right?

outer flax
#

@ivory urchin every commands are fetch on login ?

outer flax
ivory urchin
ivory urchin
outer flax
#

@ivory urchin it's not fetch by default
console.log(client.application.commands.cache);
Collection(0) [Map] {}

spring osprey
#

and.. is there a way to send a ephermal message when... a subcomand is r-ran?

outer flax
#
await interaction.reply({ content: 'Secret Pong!', ephemeral: true });
spring osprey
#

in... sapphireJs is this?

ivory urchin
ivory urchin
#

It doesn't change anything in discord.js

spring osprey
#

sorry if i am asking alot of questions

#

im new to sapphirejs and discord.js....

ivory urchin
#

Have you read the guide on the website?

ivory urchin
#

It will guide you through your first command

pine harnessBOT
ivory urchin
#

I gtg, hope you get everything figured out 🙂

outer flax
#

here

#

if you want you can voc in a voice channel and i can help you

spring osprey
#

iran is weird with discord voice channels

outer flax
# spring osprey can you remove only 1 slash command?
const { Client } = require('discord.js');
const client = new Client({ intents: [] });

const commandId = 'commandId';
client.on('ready', async () => {
    const command = client.application.commands.cache.get(commandId) ?? await client.application.commands.fetch(commandId);
    command.delete().then(() => console.log(`Deleted command ${command.name}`)).catch(console.error);
    client.destroy();
});

client.login('token');```
spring osprey
#

just gets stuck on "connecting"

outer flax
#

use ?? to use the second instruction if it is undefined or null

outer flax
spring osprey
#

yea

#

wait let me switch to my other net

outer flax
#

you can try website version

spring osprey
#

done

#

maybe i can join now

#

#746093494224945294?

#

so.

outer flax
#

sorry for my bad english, im french

spring osprey
#

holy crappo moly. i just closed steam and audio BLASTED

outer flax
#

??

spring osprey
#

why does steam have its own device driver?????

outer flax
#

are u laggy ?

outer flax
spring osprey
#

my pc defaulted the output device to the steam streaming audio device

#

which was unplugged

#

sorry i cant talk btw

#

dont have a mic sadly

#

wait

#

ohhhh wait

#

i figured it out

#

dumb me

inner trench
outer flax
#

@ivory urchin sorry

ivory urchin
#

@inner trench can I pr a new tag for the delete a command question that recommends either 1. Using that website 2. Using <client.application | guild>.commands.delete and 3. Waiting for that BulkOverwrite pr?