make channel names not case-sensitive
This commit is contained in:
parent
d1114afeab
commit
dbff59af1b
|
@ -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.`);
|
||||||
|
|
Loading…
Reference in a new issue