SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module.exports.run = async (Happy, message, args) => { //this is what will run when the command is called.
  2.    
  3.         var issuer = message.author;
  4.             //time variables
  5.         var clock = new Date();
  6.         var ss = String(clock.getSeconds()).padStart(2, '0');
  7.         var min = String(clock.getMinutes()).padStart(2, '0');
  8.         var hrs = String(clock.getHours()).padStart(1, '0');
  9.         clock = hrs + ':' + min +':' + ss;
  10.  
  11.         var TheDate = new Date()
  12.         var zilelesaptamanii = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
  13.         var weekday = zilelesaptamanii[TheDate.getDay()];
  14.         var dd = String(TheDate.getDate()).padStart(2, '0');
  15.         var mon = String(TheDate.getMonth()+ 1);
  16.         var year = String(TheDate.getFullYear()).padStart(4,'00');
  17.         TheDate = weekday+", " + mon + '/' + dd +'/' + year;
  18.         //end of time variables
  19.  
  20.         //verify if it's pm or AM
  21.         let amORpm;
  22.         if(hrs >= 0 && hrs <= 12){
  23.             amORpm = "AM"
  24.         }else{
  25.             amORpm = "PM"
  26.         };
  27.  
  28.         if(message.mentions.everyone || message.content.includes("@everyone")){
  29.           return message.reply("I can't kick everyone, only 1 member at a time!")
  30.         }
  31.        
  32.         var kickMember = message.mentions.users.first() || message.guild.members.get(args[0]);
  33.         let user1 = kickMember+`, DISCRIMINATORY ID: #${kickMember.discriminator}`;
  34.         var test = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
  35.        
  36.         if(message.guild.member(message.mentions.users.first()).id === '318765148867395605'){
  37.           await message.channel.send(attachmentha2);
  38.           return message.reply("You can't kick me!")
  39.         }
  40.         if(message.guild.member(message.mentions.users.first()).id === '186533323403689986'){
  41.           await message.channel.send(attachmentha);
  42.           return message.reply("Don't you think you're trying your luck to much?")
  43.         }
  44.        
  45.         //if Happy doesn't have permissions or if the caller doesn't have permissions
  46.         if(!message.member.hasPermission(["KICK_MEMBERS","ADMINISTRATOR"]))
  47.             return message.channel.send(`${issuer} , you're not powerful enough to kick someone! Come back later when you're strong enough.`);
  48.            
  49.         if(!message.guild.me.hasPermission(["KICK_MEMBERS","ADMINISTRATOR"])) return message.channel.send(`${issuer} , I'm not strong enough to perform this task!*(missing permissions for me)*.`)
  50.         let reason = args.slice(1).join(" ");
  51.         if(test.hasPermission("ADMINISTRATOR")) {
  52.           return message.reply("I can't do that since he/she has more power than me.").then(sent => console.log(`${issuer} tried to use "!mute" command on Object ID: ${user1} , ACCESS: DENIED, REASON: He/She has Administrator permissions or higher role than Happy!`)).catch(console.error);
  53.         }
  54.         if(!kickMember) {return message.channel.send(`You must mention someone to kick him!`)};
  55.         if(!reason){reason = "No reason given!"};
  56.        
  57.        
  58.         if(kickMember.id === message.author.id){
  59.           return message.reply(" You can't ban yourself.")
  60.         }
  61.         if(test.highestRole.position >= message.member.highestRole.position){
  62.             return message.reply(` ${kickMember} is higher rank than you.`)
  63.         }
  64.  
  65.  
  66.         // Ignore messages that aren't from a guild
  67.         if (!message.guild) return;
  68.         kickMember.send(`Hello, you have been kicked from **${message.guild.name}** for: ${reason}`).then(()=>
  69.         kickMember.kick()).catch(err => console.log(err));
  70.  
  71.         await console.log(`${issuer.username}#${issuer.discriminator} used "!kick" command on Object ID: ${user1} , ACCESS: ALLOWED, REASON: ${reason} DATE OF KICK: ${TheDate + " at " + clock +" " +amORpm}`)
  72.         await message.channel.send(`**${kickMember}** has been banished from **${message.guild.name}**!`).then(m => m.delete(5000))
  73.  
  74.     let embed = new Discord.RichEmbed()
  75.     .setAuthor(' Action | Kick', `http://pluspng.com/img-png/thor-hammer-png--1600.png`)
  76.     .addField('Moderator that issued the kick: ', `${issuer}`,true)
  77.     .addField('Member kicked: ', `<@${kickMember.id}>`,true)
  78.     //.addField(`How much time got banned?:`,`${mutetime} seconds = (${realtime}) ${convertor}`,true)
  79.     .addField('Reason of kick: ', `${reason}`,true)
  80.     .addField(`When it was kicked that person:`,TheDate + " at " +clock+" "+amORpm,true)
  81.     .setColor('#D9D900')
  82.  
  83.     const modlog = message.guild.channels.find(channel => channel.name === 'mod-logs');
  84.     modlog.send(embed);
  85.  
  86.    
  87.     }//end of running the command
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top