Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require("fs");
- const blacklist = JSON.parse(fs.readFileSync("./json/blacklist.json", "utf8"));
- const Discord = require('discord.js')
- module.exports.run = (bot, message) => {
- let Staff = ["460050907372191744", "490220102650953729", "470995132221620224", "530779624599322644"];
- if (Staff.includes(message.author.id)) {
- let args = message.content.split(" ").slice(1);
- const id = args[0]
- const iduser = args[0]
- const reason = message.content.split(" ").slice(18);
- let bl = bot.channels.get('586571972826103808');
- let blacklist1 = new Discord.RichEmbed()
- .setTitle(`BlackList par ${message.author.username}`)
- .addField("<:emoji_23:565782397636050947> ❱ Pseudo:", `<@${id}>`)
- .addField("<:emoji_25:556931604107493407> ❱ ID:", `${id}`)
- .addField("<:emoji_6:565781793652080644> ❱ Raison:", "**" + args.join(" ").slice(18) + "**")
- .setColor("#36393f")
- .setFooter(`BlackListed`)
- .setTimestamp();
- bl.send(blacklist1);
- if (blacklist[id]) {
- return message.channel.send("<:1548000265801:536578104458608660> Erreur: **ID** déjà blacklist");
- }else{
- if (id.length === 0) {
- blacklist[id] = {"reason" : true};
- message.delete();
- message.channel.send(`<:yes:531943485956292619> **ID** ` + '"' + id + '"' + `a bien été blacklisté :wink:`)
- }else{
- // blacklist[id] = {"reason" : "Blacklisted-Id: " + args.join(" ") + ". Blacklisted by: " + message.author.username};
- blacklist[id] = {"reason" : args.join(" ").slice(18)};
- message.delete();
- message.channel.send(`<:yes:531943485956292619> **<@${id}>**(${id}) a bien été blacklisté :wink:`)
- }
- fs.writeFile("./json/blacklist.json", JSON.stringify(blacklist), (err) => { if (err) console.error(err);});
- }
- console.log(`[BlackList] "${id}" a été blacklist! Par: ${message.author.username}. Raison: ${args}`)
- }else{
- message.channel.send(`:octagonal_sign: Désolé mais tu est pas du staff. !${message.author}`)}
- }
- module.exports.help = {
- name: "gban",
- aliases: ["bl"]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement