Remove old logChannelId fallback, add additional verification that the log channel is a text channel
parent
56bc979863
commit
69352eb756
11
src/utils.js
11
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue