20 lines
543 B
JavaScript
20 lines
543 B
JavaScript
|
import { logger } from "@discordeno/utils"
|
||
|
|
||
|
import REST from "../src/lib/handlers/RESTHandler"
|
||
|
import CommandHandler from "../src/lib/handlers/CommandHandler"
|
||
|
|
||
|
const SlashCommandHandler = new CommandHandler()
|
||
|
const commands = await SlashCommandHandler.load()
|
||
|
const registered = await REST.getGlobalApplicationCommands()
|
||
|
|
||
|
for (let { id, name, type } of registered) {
|
||
|
const cmd = commands.get(name)
|
||
|
if (cmd && cmd.type == type) continue
|
||
|
|
||
|
await REST.deleteGlobalApplicationCommand(id)
|
||
|
|
||
|
console.log(`Deleted ${name}(${id})`)
|
||
|
}
|
||
|
|
||
|
process.exit()
|