19 lines
600 B
TypeScript
19 lines
600 B
TypeScript
import { REST, Routes } from "discord.js"
|
|
import env from "../src/utils/Env"
|
|
import tryCatch from "../src/utils/Functions/trycatch"
|
|
import { log } from "../src/utils/Logger"
|
|
|
|
const rest = new REST({ version: "10" }).setToken(env.dev.DEVTOKEN)
|
|
|
|
const [error] = await tryCatch(deleteCommands())
|
|
if (error) log.error(error)
|
|
|
|
async function deleteCommands() {
|
|
log.info("Started deleting application (/) commands.")
|
|
await rest.put(
|
|
Routes.applicationGuildCommands(env.dev.DEVID, env.dev.GUILDID),
|
|
{ body: [] }
|
|
)
|
|
log.info("Successfully deleted application (/) commands.")
|
|
}
|