You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small bug where the bot does not recognize channels that were added after the bot has started.
Happens because the 'gatherChannels' function only get called once when the bot starts.
discord.js has an event 'channelCreate' and 'channelDelete', so it should not be a problem to track channels in realtime too.
Will implement this in the next pull request.
The text was updated successfully, but these errors were encountered:
@NilsKrause and @LilithTheSuccubus
This can also be addressed by serching the channelID dynamically.
channel = msg.guild.channels.cache.filter((channel)=>{ return channel.name === channelName && channel.type === 'voice'; });
var channelID = "";
if(channel.size == 0){
util.print(msg,'',"There is no such channel. Maybe you made a typo?",'red');
return;
}else if(channel.size != 1){
util.print(msg,'',`I have found ${channel.size} channels with the same name.\nPlease rename the channels so I can select the correct one.`,'red');
return;
}else{
channelID = channel.first().id;
}
With this, there's no need to have a Collection of channels, neither a gather function.
In this code I have asume that I'm searching for voice channels only and also forcing the user to have unique voice channel names.
Small bug where the bot does not recognize channels that were added after the bot has started.
Happens because the 'gatherChannels' function only get called once when the bot starts.
discord.js has an event 'channelCreate' and 'channelDelete', so it should not be a problem to track channels in realtime too.
Will implement this in the next pull request.
The text was updated successfully, but these errors were encountered: