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

100
index.js
View file

@ -92,26 +92,19 @@ 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 => {
member.voice.setChannel(toChannel).catch(err => {
// Do nothing, 99% missing permissions
});;
});
}
});
interaction.reply({
content: "Moved all users to " + toChannel.name,
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
interaction.guild.channels.cache.forEach(channel => {
if (channel?.type == Discord.ChannelType.GuildVoice) {
channel.members.forEach(member => {
member.voice.setChannel(toChannel).catch(err => {
// Do nothing, 99% missing permissions
});;
});
}
});
interaction.reply({
content: "Moved all users to " + toChannel.name,
ephemeral: true
});
break;
case "move":
fromChannel = interaction.options.getChannel("from");
@ -122,41 +115,27 @@ 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 => {
fromChannel?.members?.forEach(member => {
member.voice?.setChannel(toChannel).catch(err => {
// Do nothing, 99% missing permissions
});;
});
interaction.reply({
content: "Moved all users from " + fromChannel.name + " to " + toChannel.name,
ephemeral: true
});
break;
case "disconnectall":
interaction.guild.channels.cache.forEach(channel => {
channel.members?.forEach(member => {
member.voice.setChannel(null).catch(err => {
// Do nothing, 99% missing permissions
});;
});
interaction.reply({
content: "Moved all users from " + fromChannel.name + " to " + toChannel.name,
content: "Disconnected all users",
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
});;
});
interaction.reply({
content: "Disconnected all users",
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
});
break;
case "disconnect":
@ -167,22 +146,15 @@ 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
});
channel?.members?.forEach(member => {
member.voice?.setChannel(null).catch(err => {
// Do nothing, 99% missing permissions
});
interaction.reply({
content: "Disconnected all users from " + channel.name,
ephemeral: true
});
} else {
return interaction.reply({
content: "You must specify a voice channel",
ephemeral: true
});
}
});
interaction.reply({
content: "Disconnected all users from " + channel.name,
ephemeral: true
});
break;
}
});