This commit is contained in:
2025-08-11 21:17:26 +02:00
parent ba81ce67c7
commit e8d8b449ce
3 changed files with 18 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
import { RedisClient } from "bun"
import { LoadEventsOptions } from "~/typings"
import { ExtendedClient as Client } from "~/utils/Client"
import env from "./Env"
import loadAllEvents from "./Events/loadevents"
@@ -7,12 +8,9 @@ import { log } from "./Logger"
const client = new Client()
const redis = new RedisClient(env.prod.REDISURI)
const ft = bun__build !== true ? "ts" : "js"
const dir = bun__docker !== true ? bun__build !== true ? "src" : "dist" : ""
class Illegitimate {
async start() {
await loadAllEvents(client, { ft, dir })
await loadAllEvents(client, this.getOpts())
await client.start()
await this.databases()
this.loadMethods()
@@ -28,6 +26,20 @@ class Illegitimate {
})
}
private getOpts(): LoadEventsOptions {
if (process.env.BUN__DOCKER === "true") {
return {
ft: "js",
dir: ""
}
} else {
return {
ft: "ts",
dir: "src"
}
}
}
private loadMethods() {
String.prototype.removeIndents = function(this: string) {
return this.replace(/^ */gm, "")