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