const Discord = require('discord.js'); module.exports = { name: "voicemoveall", aliases: ["vcmoveall"], description: "Permet de faire venir tous les membres en vocal du serveur dans un channel", category: 'moderation', emote: '🔊', utilisation: 'voicemoveall [#channel/id]', async execute(message, args, client) { let channelInput = message.mentions.channels.first() || message.guild.channels.cache.get(args[0]) || message.member.voice.channel; if (!channelInput) return message.channel.send(`Vous devez ĂȘtre dans un salon vocal pour utiliser cette commande ou sinon en mentionner un.`) if (channelInput.type !== Discord.ChannelType.GuildVoice) return; const channels = message.guild.channels.cache.filter(ch => ch.id !== channelInput.id && ch.type !== Discord.ChannelType.GuildVoice && ch.members.size > 0) for await(const [_, channel] of channels) for await(const [_, member] of channel.members) { await member.voice.setChannel(channelInput, `voicemoveall by ${message.author.tag}`).catch(() => { }) } message.channel.send(`Tout les membres ont Ă©tĂ© dĂ©placĂ© vers ${channelInput}`) } }