From 800668f3e0fec80f3ba08f115d9563324bc54045 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:53:53 -0400 Subject: deploy stuff --- lib/utils/BotClientUtils.ts | 5 ++++- lib/utils/UpdateCache.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/utils') diff --git a/lib/utils/BotClientUtils.ts b/lib/utils/BotClientUtils.ts index a251bdf..1dd46bf 100644 --- a/lib/utils/BotClientUtils.ts +++ b/lib/utils/BotClientUtils.ts @@ -469,7 +469,10 @@ export class BotClientUtils { if (!(channel in channels)) throw new TypeError(`Invalid channel provided (${channel}), must be one of ${Object.keys(channels).join(' ')}`); - const channelId = channels[channel]; + const channelConfig = channels[channel]; + const environment = this.client.config.environment; + + const channelId = typeof channelConfig === 'string' ? channelConfig : channelConfig[environment]; if (channelId === '') return null; const res = await this.client.channels.fetch(channelId); diff --git a/lib/utils/UpdateCache.ts b/lib/utils/UpdateCache.ts index 2f96d9d..0e39344 100644 --- a/lib/utils/UpdateCache.ts +++ b/lib/utils/UpdateCache.ts @@ -14,7 +14,7 @@ export async function updateGlobalCache(client: Client) { } export async function updateSharedCache(client: Client) { - const row: { [x: string]: any } = ((await Shared.findByPk(0)) ?? (await Shared.create())).toJSON(); + const row: { [x: string]: any } = ((await Shared.findByPk(0)) ?? (await Shared.create({ primaryKey: 0 }))).toJSON(); for (const option in row) { if (Object.keys(client.cache.shared).includes(option)) { -- cgit