bun-terry/bin/delete.js

17 lines
477 B
JavaScript
Raw Permalink Normal View History

2024-04-18 18:56:15 +00:00
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();
2024-07-26 05:27:44 +00:00
const id = process.argv[2];
const cmd = registered.find((_) => _.id === id);
if (cmd) {
2024-04-18 18:56:15 +00:00
await REST.deleteGlobalApplicationCommand(id);
2024-07-26 05:27:44 +00:00
logger.info(`Deleted ${cmd.name}(${id})`);
2024-04-18 18:56:15 +00:00
}
process.exit();