Remove the check

This commit is contained in:
Christopher Cookman 2024-06-28 18:23:49 -06:00
parent 4336162c36
commit 8efc569cea
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -92,7 +92,6 @@ client.on('interactionCreate', async interaction => {
ephemeral: true
});
}
if (toChannel?.type == Discord.ChannelType.GuildVoice) {
interaction.guild.channels.cache.forEach(channel => {
if (channel?.type == Discord.ChannelType.GuildVoice) {
channel.members.forEach(member => {
@ -106,12 +105,6 @@ client.on('interactionCreate', async interaction => {
content: "Moved all users to " + toChannel.name,
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
break;
case "move":
fromChannel = interaction.options.getChannel("from");
@ -122,7 +115,6 @@ client.on('interactionCreate', async interaction => {
ephemeral: true
});
}
if (fromChannel?.type == Discord.ChannelType.GuildVoice || toChannel?.type == Discord.ChannelType.GuildVoice) {
fromChannel?.members?.forEach(member => {
member.voice?.setChannel(toChannel).catch(err => {
// Do nothing, 99% missing permissions
@ -132,16 +124,9 @@ client.on('interactionCreate', async interaction => {
content: "Moved all users from " + fromChannel.name + " to " + toChannel.name,
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
break;
case "disconnectall":
interaction.guild.channels.cache.forEach(channel => {
if (channel?.type == Discord.ChannelType.GuildVoice) {
channel.members?.forEach(member => {
member.voice.setChannel(null).catch(err => {
// Do nothing, 99% missing permissions
@ -151,12 +136,6 @@ client.on('interactionCreate', async interaction => {
content: "Disconnected all users",
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
});
break;
case "disconnect":
@ -167,7 +146,6 @@ client.on('interactionCreate', async interaction => {
ephemeral: true
});
}
if (channel?.type == Discord.ChannelType.GuildVoice) {
channel?.members?.forEach(member => {
member.voice?.setChannel(null).catch(err => {
// Do nothing, 99% missing permissions
@ -177,12 +155,6 @@ client.on('interactionCreate', async interaction => {
content: "Disconnected all users from " + channel.name,
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
break;
}
});