bun-terry/bin/delete.js
2024-07-26 01:27:44 -04:00

16 lines
477 B
JavaScript

import { logger } from "@discordeno/utils";
import REST from "../src/lib/handlers/RESTHandler";
import * as InteractionHandler from "../src/lib/handlers/InteractionHandler";
await InteractionHandler.load();
const registered = await REST.getGlobalApplicationCommands();
const id = process.argv[2];
const cmd = registered.find((_) => _.id === id);
if (cmd) {
await REST.deleteGlobalApplicationCommand(id);
logger.info(`Deleted ${cmd.name}(${id})`);
}
process.exit();