Moved to bun

This commit is contained in:
2025-08-09 23:42:54 +02:00
parent 8a686222be
commit 30e18257d0
20 changed files with 608 additions and 5078 deletions

View File

@@ -1,30 +1,27 @@
import { Redis } from "ioredis"
import { RedisClient } from "bun"
import { ExtendedClient as Client } from "~/utils/Client"
import env from "~/utils/Env"
import env from "./Env"
import loadAllEvents from "./Events/loadevents"
import { log } from "./Logger"
const client = new Client()
const redis = new Redis(env.prod.REDISURI)
let ft: "js" | "ts"
if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT === "true") {
ft = "ts"
} else {
ft = "js"
}
const redis = new RedisClient(env.prod.REDISURI)
class Illegitimate {
async start() {
await loadAllEvents(client, ft)
await loadAllEvents(client)
await client.start()
await this.databases()
this.loadMethods()
}
private async databases() {
redis.on("ready", () => {
redis.connect().then(() => {
log.custom("Connected to Redis", "info", { type: "preset", color: "green" })
}).catch(() => {
log.error("Failed to connect to Redis")
}).finally(() => {
redis.close()
})
}