Skip to content

Commit

Permalink
fixed env on util.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed Jun 26, 2024
1 parent 47e26cc commit 5941fef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import * as logger from "./logger.ts"
import * as config from "./config.ts"
import * as client from "./client.ts"

const _env = env ?? process.env

export type PermissionsNames = keyof typeof v10.PermissionFlagsBits

export async function checkUpdates() {
Expand Down Expand Up @@ -86,7 +88,7 @@ export async function checkUpdates() {
}
}

const locale = env.BOT_LOCALE
const locale = _env.BOT_LOCALE

import(`dayjs/locale/${locale ?? "en"}.js`)
.then(() => dayjs.locale(locale ?? "en"))
Expand All @@ -104,7 +106,7 @@ dayjs.extend(timezone)
dayjs.extend(toObject)
dayjs.utc(1)

if (env.BOT_TIMEZONE) dayjs.tz.setDefault(env.BOT_TIMEZONE)
if (_env.BOT_TIMEZONE) dayjs.tz.setDefault(_env.BOT_TIMEZONE)

export { dayjs }

Expand Down

0 comments on commit 5941fef

Please sign in to comment.