#How do i delete a slash command?
1 messages · Page 1 of 1 (latest)
Use discordjs like that
import discordjs then remove it...?
can you remove only 1 slash command?
When you use body: [], you remove the all slash command
I think you can, I power on my computer
Wait
okie then
and
does sapphire have discordjs included or do i have to import it myself?
You'd have to import it yourself
okayie then
But btw I'd also recommend
https://slash-commands-gui.androz2091.fr/settings
Graphical User Interface to explore and edit your bot's slash commands!
uhhhhh
It's a GUI so you can manage your commands online
oh okay'
No, import it yourself
okayie
Amazing
i dont know which message to set as solved
this or
His message
this...?
No
okay then, thanks for your helps!
Thank you for marking this question as solved!
1051476027500675174
1051477771471290398
@ivory urchin's message
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*
why am i using htis
i should use the tool you gave me
you can use also this
global: https://discord.js.org/#/docs/discord.js/v13/class/ApplicationCommand?scrollTo=delete
guild: https://discord.js.org/#/docs/discord.js/v13/class/ApplicationCommandManager?scrollTo=delete
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);```
okay
again. thanks for all your helps. i dont know how much to thank you 2 tbh
god im making alot of text mistakes
Lol np
Btw you can just do client.application.commands.delete and skip the fetch middleman
fetch just checks if the command exists right?
@ivory urchin every commands are fetch on login ?
it resolve it
Yeah, and gives you an object representation of it
Idk, but it doesn't have to be fetched as long as you have the ID
@ivory urchin it's not fetch by default
console.log(client.application.commands.cache);
Collection(0) [Map] {}
and.. is there a way to send a ephermal message when... a subcomand is r-ran?
await interaction.reply({ content: 'Secret Pong!', ephemeral: true });
in... sapphireJs is this?
it doesn't have to be fetched as long as you have the ID
Sapphire is just a framework that makes a few things easier in bot creation. Everything you do is still discord.js
It doesn't change anything in discord.js
is this correct...?
const { SapphireClient } = require('@sapphire/framework');
require('dotenv').config()
const client = new SapphireClient({ intents: ['GUILDS', 'GUILD_MESSAGES'] });
await interaction.reply({ content: 'Secret Pong!', ephemeral: true });
client.login(process.env.token);
sorry if i am asking alot of questions
im new to sapphirejs and discord.js....
Have you read the guide on the website?
interaction is undefined
It will guide you through your first command
<:_:746069730170896405> Sapphire guide results:
Getting Started / Getting started with Sapphire
I gtg, hope you get everything figured out 🙂
here
if you want you can voc in a voice channel and i can help you
iran is weird with discord voice channels
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');```
just gets stuck on "connecting"
use ?? to use the second instruction if it is undefined or null
maybe your discord, what did you use ? The electron app ?
you can try website version
sorry for my bad english, im french
holy crappo moly. i just closed steam and audio BLASTED
??
why does steam have its own device driver?????
are u laggy ?
what did you mean ?
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
@ivory urchin is "Her" btw
@ivory urchin sorry
thanks for this
it just amazing
@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?