mirror of
https://github.com/litruv/DAdmin.git
synced 2026-07-25 03:06:11 +10:00
Added error checking for no users mentioned
This commit is contained in:
@@ -8,15 +8,18 @@ module.exports = {
|
||||
category: 'admin',
|
||||
command: (client, msg) => {
|
||||
if (msg.mentions.members.array().length > 0)
|
||||
msg.member.guild.createChannel('Kicked', 'voice')
|
||||
.then(channel => {
|
||||
msg.mentions.members.first().setVoiceChannel(channel.id);
|
||||
c = channel;
|
||||
setTimeout(function () {
|
||||
c.delete()
|
||||
}, 150);
|
||||
})
|
||||
.catch(console.error);
|
||||
if (msg.mentions.members.first().voiceChannelID != undefined)
|
||||
msg.member.guild.createChannel('Kicked', 'voice')
|
||||
.then(channel => {
|
||||
msg.mentions.members.first().setVoiceChannel(channel.id);
|
||||
c = channel;
|
||||
setTimeout(function () {
|
||||
c.delete()
|
||||
}, 150);
|
||||
})
|
||||
.catch(console.error);
|
||||
else
|
||||
msg.reply("User isn't in a channel")
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user