Check if channel is not undefined

Closes #144
This commit is contained in:
chroventer
2020-10-26 22:39:37 -07:00
parent 8bfed8bb5c
commit 5480b8711d
+2 -1
View File
@@ -86,7 +86,8 @@ export async function hasChannelPermissions(
permissions: Permissions[],
) {
const channel = await cacheHandlers.get("channels", channelID);
if (!channel?.guildID) return true;
if (!channel) return false;
if (!channel.guildID) return true;
const guild = await cacheHandlers.get("guilds", channel.guildID);
if (!guild) return false;