Added new logger

This commit is contained in:
2024-11-14 18:44:07 +01:00
parent c868edcae4
commit d938dd9d3e
16 changed files with 81 additions and 129 deletions

View File

@@ -2,6 +2,7 @@ import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
import fs from "fs"
import { ICommand } from "../src/interfaces"
import env from "../src/utils/Env"
import { log } from "../src/utils/Logger.js"
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken)
const commands: RESTPutAPIApplicationCommandsJSONBody = []
@@ -22,13 +23,13 @@ for (const file of contentMenuCommands) {
}
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`)
log(`Started refreshing ${commands.length} application (/) commands.`)
await rest.put(
Routes.applicationGuildCommands(env.dev.devid, env.dev.guildid),
{ body: commands }
).then(() => {
console.log(`Successfully reloaded ${commands.length} application (/) commands.`)
log(`Successfully reloaded ${commands.length} application (/) commands.`)
process.exit(0)
})
} catch (error) {