bun-terry/bin/delete.js
2024-04-18 14:56:15 -04:00

19 lines
596 B
JavaScript

import { logger } from "@discordeno/utils";
import REST from "../src/lib/handlers/RESTHandler";
import * as InteractionHandler from "../src/lib/handlers/InteractionHandler";
import * as CommandHandler from "../src/lib/handlers/CommandHandler";
await InteractionHandler.load();
const registered = await REST.getGlobalApplicationCommands();
for (let { id, name, type } of registered) {
const cmd = CommandHandler.commands.get(name);
if (cmd && cmd.type == type) continue;
await REST.deleteGlobalApplicationCommand(id);
logger.info(`Deleted ${name}(${id})`);
}
process.exit();