modpack-server/bin/delete.js
cirroskais a43b20180f Fuck
2024-02-12 02:43:32 -05:00

19 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()