SHARE
TWEET

Untitled

a guest Sep 18th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (message.content.startsWith('!kick')) {
  2.     let messageArray = message.content.split(" ");
  3.     let args = messageArray.slice(1);
  4.     let kickedUser = message.guild.member(
  5.       message.mentions.users.first() || message.guild.members.get(args[0])
  6.     );
  7.     let kickedReason = args.join(" ").slice(22);
  8.    
  9.     if (!kickedUser) return message.channel.send("L'utilisateur n'existe pas !");
  10.     if (!message.member.hasPermission("KICK_MEMBERS"))
  11.       return message.channel.send("Vous n'avez pas les permissions.");
  12.     if (kickedUser.hasPermission("KICK_MEMBERS"))
  13.       return message.channel.send("Vous ne pouvez pas kick cette personne.");
  14.  
  15.     const kickEmbed = new MessageEmbed()
  16.       .setDescription("Expulsion du serveur")
  17.       .setColor("#e35b00")
  18.       .addField("Utilisateur expulsé", `${kickedUser} (ID: ${kickedUser.id})`)
  19.       .addField("Modérateur :", `${message.author} (ID: ${message.author.id})`)
  20.       .addField("Raison", kickedReason)
  21.       .setTimestamp()
  22.     message.delete();
  23.     message.channel.send(kickEmbed);
  24.  
  25.     const kickEmbedPv = new MessageEmbed()
  26.       .setDescription("Expulsion du serveur")
  27.       .setColor("#e35b00")
  28.       .addField("Vous avez été expulsé du serveur pour :", kickedReason)
  29.       .addField("Modérateur :", `${message.author} (ID: ${message.author.id})`)
  30.       .setTimestamp()
  31.     kickedUser.send(kickEmbedPv)
  32.     kickedUser.kick();
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top