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,7 +2,7 @@ import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
import fs from "node:fs"
import { ICommand } from "../src/interfaces"
import env from "../src/utils/Env"
import { color } from "../src/utils/Functions/colors"
import { log } from "../src/utils/Logger.js"
const rest = new REST({ version: "10" }).setToken(env.prod.token)
const commands: RESTPutAPIApplicationCommandsJSONBody = []
@@ -19,16 +19,16 @@ for (const file of contentMenuCommands) {
}
try {
console.log(color(`Started refreshing ${commands.length} application (/) commands.`, "green"))
log(`Started refreshing ${commands.length} application (/) commands.`, "info", { type: "preset", color: "green" })
const commandsString = commands.map(command => " " + command.name)
console.log(color(commandsString.join("\n"), "lavender"))
log(commandsString.join("\n"), "info", { type: "preset", color: "lavender" })
await rest.put(
Routes.applicationCommands(env.dev.clientid),
{ body: commands }
).then(() => {
console.log(color(`Successfully reloaded ${commands.length} application (/) commands.`, "green"))
log(`Successfully reloaded ${commands.length} application (/) commands.`, "info", { type: "preset", color: "green" })
process.exit(0)
})
} catch (error) {