From f56f33e215083a21d36e3de397ab2767cfaf5b5b Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Sat, 11 Jun 2022 18:27:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20getEmbedConfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/helpers/getEmbedConfig/index.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/helpers/getEmbedConfig/index.ts b/src/helpers/getEmbedConfig/index.ts index 22ddf29..ccd3fdb 100644 --- a/src/helpers/getEmbedConfig/index.ts +++ b/src/helpers/getEmbedConfig/index.ts @@ -3,18 +3,16 @@ import * as embedConfig from "../../config/embed"; import { Guild } from "discord.js"; -export default async (guild: Guild | null) => { - if (guild == null) - return { - ...embedConfig, - }; +export default async (guild?: Guild | null) => { + if (!guild) { + return { ...embedConfig }; + } const guildConfig = await guildSchema.findOne({ guildId: guild.id }); - - if (guildConfig == null) + if (!guildConfig) { return { ...embedConfig, }; - + } return guildConfig.embeds; };