modpack-server/bin/delete.js

20 lines
543 B
JavaScript
Raw Permalink Normal View History

2024-02-12 07:43:32 +00:00
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()