Added new tryCatch wrapper
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
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)
|
||||
|
||||
try {
|
||||
const [error] = await tryCatch(deleteCommands())
|
||||
if (error) log(error, "error")
|
||||
|
||||
async function deleteCommands() {
|
||||
log("Started deleting application (/) commands.", "info")
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.DEVID, env.dev.GUILDID),
|
||||
{ body: [] }
|
||||
)
|
||||
log("Successfully deleted application (/) commands.", "info")
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user