-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
29 lines (23 loc) · 996 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Require the necessary discord.js classes
const { Client, GatewayIntentBits } = require("discord.js");
const { token } = require("./config.json");
const { SlashCommandBuilder, Routes } = require("discord.js");
const { REST } = require("@discordjs/rest");
const { clientId, guildId } = require("./config.json");
// Create a new client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const rest = new REST({ version: "10" }).setToken(token);
rest
.put(Routes.applicationCommands(clientId), { body: [] })
.then(() => console.log("Successfully deleted all application commands."))
.catch(console.error);
rest
.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
.then(() => console.log("Successfully deleted all guild commands."))
.catch(console.error);
// When the client is ready, run this code (only once)
client.once("ready", () => {
console.log("Ready!");
});
// Login to Discord with your client's token
client.login(token);