From 30d0e8a571ccb8f82049e96caee14361e8407f86 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Tue, 3 Nov 2020 14:58:40 +0530 Subject: [PATCH] More lint error fixes (completed hopefully) --- src/utils/delay.ts | 2 +- src/utils/getChannelByType.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/delay.ts b/src/utils/delay.ts index d0c5de7..6fcb1ec 100644 --- a/src/utils/delay.ts +++ b/src/utils/delay.ts @@ -1,3 +1,3 @@ -export const delay = (ms: number) => new Promise((resolve, reject) => { +export const delay = async (ms: number): Promise => await new Promise((resolve, reject) => { setTimeout(() => resolve(true), ms); }); \ No newline at end of file diff --git a/src/utils/getChannelByType.ts b/src/utils/getChannelByType.ts index 428c083..5a8b83a 100644 --- a/src/utils/getChannelByType.ts +++ b/src/utils/getChannelByType.ts @@ -39,16 +39,16 @@ const getChannelByType = ( | undefined => { switch (data.type) { case ChannelTypes.GUILD_CATEGORY: - if(!guild) throw new Error("No Guild was provided to construct Channel") + if(guild === undefined) throw new Error("No Guild was provided to construct Channel") return new CategoryChannel(client, data as GuildChannelCategoryPayload, guild) case ChannelTypes.GUILD_NEWS: - if(!guild) throw new Error("No Guild was provided to construct Channel") + if(guild === undefined) throw new Error("No Guild was provided to construct Channel") return new NewsChannel(client, data as GuildNewsChannelPayload, guild) case ChannelTypes.GUILD_TEXT: - if(!guild) throw new Error("No Guild was provided to construct Channel") + if(guild === undefined) throw new Error("No Guild was provided to construct Channel") return new GuildTextChannel(client, data as GuildTextChannelPayload, guild) case ChannelTypes.GUILD_VOICE: - if(!guild) throw new Error("No Guild was provided to construct Channel") + if(guild === undefined) throw new Error("No Guild was provided to construct Channel") return new VoiceChannel(client, data as GuildVoiceChannelPayload, guild) case ChannelTypes.DM: return new DMChannel(client, data as DMChannelPayload)