Advertisement
Senkey

Untitled

Jun 30th, 2020
1,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const fs = require("fs");
  2. const blacklist = JSON.parse(fs.readFileSync("./json/blacklist.json", "utf8"));
  3. const Discord = require('discord.js')
  4.  
  5. module.exports.run = (bot, message) => {
  6.     let Staff = ["460050907372191744", "490220102650953729", "470995132221620224", "530779624599322644"];
  7.     if (Staff.includes(message.author.id)) {
  8.         let args = message.content.split(" ").slice(1);
  9. const id = args[0]
  10. const iduser = args[0]
  11. const reason = message.content.split(" ").slice(18);
  12.  
  13. let bl = bot.channels.get('586571972826103808');
  14. let blacklist1 = new Discord.RichEmbed()
  15. .setTitle(`BlackList par ${message.author.username}`)
  16.         .addField("<:emoji_23:565782397636050947> ❱ Pseudo:", `<@${id}>`)
  17.         .addField("<:emoji_25:556931604107493407> ❱ ID:", `${id}`)
  18. .addField("<:emoji_6:565781793652080644> ❱ Raison:", "**" + args.join(" ").slice(18) + "**")
  19. .setColor("#36393f")
  20. .setFooter(`BlackListed`)
  21. .setTimestamp();
  22. bl.send(blacklist1);
  23.  
  24.     if (blacklist[id]) {
  25.         return message.channel.send("<:1548000265801:536578104458608660> Erreur: **ID** déjà blacklist");
  26.     }else{
  27.     if (id.length === 0) {
  28.     blacklist[id] = {"reason" : true};
  29.     message.delete();
  30.     message.channel.send(`<:yes:531943485956292619> **ID** ` + '"' + id + '"' + `a bien été blacklisté :wink:`)
  31.     }else{
  32. //    blacklist[id] = {"reason" : "Blacklisted-Id: " + args.join(" ") + ". Blacklisted by: " + message.author.username};
  33.  
  34.     blacklist[id] = {"reason" : args.join(" ").slice(18)};
  35.  
  36.     message.delete();
  37.     message.channel.send(`<:yes:531943485956292619>  **<@${id}>**(${id}) a bien été blacklisté :wink:`)
  38.     }
  39.     fs.writeFile("./json/blacklist.json", JSON.stringify(blacklist), (err) => { if (err) console.error(err);});
  40.     }
  41.     console.log(`[BlackList] "${id}" a été blacklist! Par: ${message.author.username}. Raison: ${args}`)
  42. }else{
  43.     message.channel.send(`:octagonal_sign: Désolé mais tu est pas du staff. !${message.author}`)}
  44. }
  45. module.exports.help = {
  46.     name: "gban",
  47.     aliases: ["bl"]
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement