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 { Client, Collection, GatewayIntentBits, Partials } from "discord.js"
import { IAutocomplete, IButton, ICommand, IContextMenu, IModal } from "~/interfaces"
import autoDeployCommands from "./Autodeploy.js"
import env from "./Env.js"
import { color } from "./Functions/colors.js"
import { log } from "./Logger.js"
export class ExtendedClient extends Client {
commands: Collection<string, ICommand> = new Collection()
@@ -33,15 +33,15 @@ export class ExtendedClient extends Client {
async start() {
let token: string
if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT === "true") {
console.log(color("Running in development mode. [tsx]", "lavender"))
log("Running in development mode. [tsx]", "info", { type: "preset", color: "lavender" })
token = env.dev.devtoken
autoDeployCommands("ts", this)
} else if (process.env.NODE_ENV === "dev" && !process.env.TYPESCRIPT) {
console.log(color("Running in development mode.", "lavender"))
log("Running in development mode.", "info", { type: "preset", color: "lavender" })
token = env.dev.devtoken
autoDeployCommands("js", this)
} else {
console.log(color("Running in production mode.", "green"))
log("Running in production mode.", "info", { type: "preset", color: "green" })
token = env.prod.token
}