Added delete commands script

This commit is contained in:
2023-12-04 11:23:27 +01:00
parent e0cf09c936
commit 0d3b01bbff
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
const { REST, Routes } = require("discord.js")
require("dotenv").config()
const token = process.env.DEVTOKEN
const clientId = process.env.DEVID
const guildId = process.env.GUILDID
const rest = new REST({ version: "10" }).setToken(token)
async function deleteCommands() {
try {
console.log("Started deleting application (/) commands.")
await rest.put(
Routes.applicationGuildCommands(clientId, guildId),
{ body: [] },
)
console.log("Successfully deleted application (/) commands.")
} catch (error) {
console.error(error)
}
}
deleteCommands()