make channel names not case-sensitive

This commit is contained in:
Alex 2021-05-03 00:38:07 -07:00
parent d1114afeab
commit dbff59af1b

View file

@ -6,7 +6,8 @@ const createNewChunk = () => {
}; };
exports.enter = function(msg, channelName) { exports.enter = function(msg, channelName) {
const voiceChannel = msg.guild.channels.cache.find(channel => channel.name === channelName); channelName = channelName.toLowerCase();
const voiceChannel = msg.guild.channels.cache.find(channel => channel.name.toLowerCase() === channelName);
if (!voiceChannel || voiceChannel.type !== 'voice') if (!voiceChannel || voiceChannel.type !== 'voice')
return msg.reply(`The channel #${channelName} doesn't exist or isn't a voice channel.`); return msg.reply(`The channel #${channelName} doesn't exist or isn't a voice channel.`);