-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrevoke.js
More file actions
23 lines (19 loc) · 777 Bytes
/
revoke.js
File metadata and controls
23 lines (19 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { REST, Routes } = require("discord.js");
const fs = require("node:fs");
const path = require("node:path");
require("dotenv").config();
const clientId = process.env.DISCORD_BOT_USER_ID;
const guildId = process.env.DISCORD_SERVER_ID;
const token = process.env.DISCORD_TOKEN;
// Construct and prepare an instance of the REST module
const rest = new REST().setToken(token);
// Revoke guild-based commands
rest
.put(Routes.applicationGuildCommands(clientId, guildId), { body: [] })
.then(() => console.log("Successfully deleted all guild commands."))
.catch(console.error);
// Revoke global commands
rest
.put(Routes.applicationCommands(clientId), { body: [] })
.then(() => console.log("Successfully deleted all application commands."))
.catch(console.error);