mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
27 lines
1.0 KiB
JavaScript
27 lines
1.0 KiB
JavaScript
const Discord = require('discord.js');
|
|
|
|
module.exports = {
|
|
name: "voicekickall",
|
|
aliases: ["vckickall"],
|
|
description: "Permet de kick tout les membres d'un channel vocal",
|
|
category: 'moderation',
|
|
emote: '🔊',
|
|
utilisation: 'voicekickall [#channel/id] ',
|
|
async execute(message, args, client) {
|
|
let channelInput = message.mentions.channels.first() || message.guild.channels.cache.get(args[0])
|
|
if (!channelInput) return;
|
|
|
|
if (channelInput.type !== Discord.ChannelType.GuildVoice) return message.reply('veuillez mentioner un salon vocal');
|
|
|
|
try {
|
|
channelInput.members.forEach(member => {
|
|
if (member.voice.channel) {
|
|
member.voice.setChannel(null)
|
|
}
|
|
})
|
|
await message.reply(`Le salon vocal ${channelInput} a été vidé.`);
|
|
} catch (error) {
|
|
await message.reply('Une erreur s\'est produite lors du déplacement des membres du salon vocal.');
|
|
}
|
|
}
|
|
} |