Moved to bun
This commit is contained in:
@@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user