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() {
|
function getLogChannel() {
|
||||||
const inboxGuild = getInboxGuild();
|
const inboxGuild = getInboxGuild();
|
||||||
|
const logChannel = inboxGuild.channels.get(config.logChannelId);
|
||||||
if (! config.logChannelId) {
|
|
||||||
logChannel = inboxGuild.channels.get(inboxGuild.id);
|
|
||||||
} else if (! logChannel) {
|
|
||||||
logChannel = inboxGuild.channels.get(config.logChannelId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! logChannel) {
|
if (! logChannel) {
|
||||||
throw new BotError('Log channel not found!');
|
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;
|
return logChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue