Added error checking for no users mentioned

This commit is contained in:
2019-03-18 18:53:16 +11:00
parent 12a7c5fe99
commit d011393f20
2 changed files with 30 additions and 23 deletions

View File

@@ -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")
}
}