From 69352eb756ecd84e4850d465411c05620d8798d2 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 5 Dec 2019 21:04:45 +0200 Subject: [PATCH] Remove old logChannelId fallback, add additional verification that the log channel is a text channel --- src/utils.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/utils.js b/src/utils.js index 7478193..0275337 100644 --- a/src/utils.js +++ b/src/utils.js @@ -47,17 +47,16 @@ function getMainGuilds() { */ function getLogChannel() { const inboxGuild = getInboxGuild(); - - if (! config.logChannelId) { - logChannel = inboxGuild.channels.get(inboxGuild.id); - } else if (! logChannel) { - logChannel = inboxGuild.channels.get(config.logChannelId); - } + const logChannel = inboxGuild.channels.get(config.logChannelId); if (! logChannel) { throw new BotError('Log channel not found!'); } + if (! (logChannel instanceof Eris.TextChannel)) { + throw new BotError('Make sure log channel is set to a text channel!'); + } + return logChannel; }