diff --git a/index.js b/index.js index 97f94f8..6f449be 100644 --- a/index.js +++ b/index.js @@ -96,7 +96,9 @@ client.on('interactionCreate', async interaction => { interaction.guild.channels.cache.forEach(channel => { if (channel?.type == Discord.ChannelType.GuildVoice) { channel.members.forEach(member => { - member.voice.setChannel(toChannel); + member.voice.setChannel(toChannel).catch(err => { + // Do nothing, 99% missing permissions + });; }); } }); @@ -122,7 +124,9 @@ client.on('interactionCreate', async interaction => { } if (fromChannel?.type == Discord.ChannelType.GuildVoice || toChannel?.type == Discord.ChannelType.GuildVoice) { fromChannel?.members?.forEach(member => { - member.voice?.setChannel(toChannel); + member.voice?.setChannel(toChannel).catch(err => { + // Do nothing, 99% missing permissions + });; }); interaction.reply({ content: "Moved all users from " + fromChannel.name + " to " + toChannel.name, @@ -139,7 +143,9 @@ client.on('interactionCreate', async interaction => { interaction.guild.channels.cache.forEach(channel => { if (channel?.type == Discord.ChannelType.GuildVoice) { channel.members?.forEach(member => { - member.voice.setChannel(null); + member.voice.setChannel(null).catch(err => { + // Do nothing, 99% missing permissions + });; }); interaction.reply({ content: "Disconnected all users", @@ -163,7 +169,9 @@ client.on('interactionCreate', async interaction => { } if (channel?.type == Discord.ChannelType.GuildVoice) { channel?.members?.forEach(member => { - member.voice?.setChannel(null); + member.voice?.setChannel(null).catch(err => { + // Do nothing, 99% missing permissions + }); }); interaction.reply({ content: "Disconnected all users from " + channel.name,