Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (command === "kick") {
- if (!message.member.roles.some(r => ["17| Chairman", "16| Vice Chairman", "15| Chief Executive Officers", "13| Developers", "12| Chief Operating Officer", "Athina", "Paradise Bot Tester", "Bot Commander"].includes(r.name)))
- return message.reply("Sorry, you don't have permissions to use this! | ** Requires Bot Commander Role**");
- let member = message.mentions.members.first();
- if (!member)
- return message.reply({
- embed: {
- color: mathforcolor,
- description: `Please mention a valid member of this server. :warning:`
- }
- });
- if (!member.kickable)
- return message.reply("I can't kick this user, make sure I'm a higher role than them. If this continues to show up, please use the ~bother command.");
- let reason = args.slice(1).join(' ');
- if (!reason)
- return message.reply({
- embed: {
- color: mathforcolor,
- description: `Please indicate a reason for the kick!`
- }
- })
- .catch(error => message.reply(`Sorry ${message.author} I couldn't kick because of : ${error}`));
- await message.channel.send('Say `Yes` if you would like to kick this user! You have 30 seconds before this prompt will cancel.')
- try {
- var response = await message.channel.awaitMessages(m => m.author.id = message.author.id, {
- max: 1,
- time: 30000,
- errors: [`time`],
- });
- if(message.author.id !== response.author.id) return;
- if (response.first().content.toLowerCase() === `yes`) {
- message.reply({
- embed: {
- color: mathforcolor,
- description: `${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`,
- },
- });
- member.ban(reason);
- client.users.get(member.id).send(`Hello, ${member.user.tag}, you have been kicked from ${message.guild.name} because: ${reason} `).catch(error => message.reply(`Sorry ${message.author} I couldn't send a ban message to this user because of : ${error} :warning:`));
- } else {
- message.channel.send('The response was not `Yes`, cancelling')
- }
- } catch (err) {
- console.log(err + 'err')
- return message.channel.send(`There was no collected message that passed the filter within the time limit or the message was not 'yes'!`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement