From 24decdbf9a46c8e2e10ec2ef89c2aa7fd25a267d Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Tue, 25 Dec 2018 19:17:07 +0100 Subject: [PATCH] fixed blacklist --- commands/admin/ban.js | 13 ++++++++++--- commands/admin/cb.js | 2 ++ commands/admin/kick.js | 2 ++ commands/admin/prune.js | 2 ++ commands/admin/tag.js | 1 + commands/admin/unban.js | 2 ++ commands/fun/advice.js | 1 + commands/fun/badmeme.js | 1 + commands/fun/clap.js | 1 + commands/fun/dank.js | 1 + commands/fun/despacito.js | 1 + commands/fun/emotesay.js | 1 + commands/fun/funfact.js | 1 + commands/fun/ib.js | 1 + commands/fun/print.js | 2 ++ commands/fun/reddit.js | 1 + commands/fun/say.js | 1 + commands/fun/sayd.js | 1 + commands/fun/tts.js | 1 + commands/fun/ttsvc.js | 1 + commands/images/fetish.js | 2 ++ commands/images/god.js | 2 ++ commands/images/human.js | 2 ++ commands/images/idubbbz.js | 2 ++ commands/images/idubbbzpaint.js | 2 ++ commands/images/like.js | 1 + commands/images/ugly.js | 1 + commands/utility/avatar.js | 1 + commands/utility/download.js | 2 ++ commands/utility/feedback.js | 2 ++ commands/utility/info.js | 2 ++ commands/utility/invite.js | 4 +++- commands/utility/ping.js | 2 ++ commands/utility/server.js | 2 ++ commands/utility/stats.js | 2 ++ commands/utility/supportme.js | 2 ++ commands/utility/translate.js | 2 +- commands/utility/updoot.js | 2 ++ 38 files changed, 67 insertions(+), 5 deletions(-) diff --git a/commands/admin/ban.js b/commands/admin/ban.js index 3fbbb497..480097ed 100644 --- a/commands/admin/ban.js +++ b/commands/admin/ban.js @@ -1,4 +1,6 @@ const { Command } = require('discord.js-commando'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class BanCommand extends Command { constructor(client) { super(client, { @@ -13,7 +15,7 @@ module.exports = class BanCommand extends Command { { key: 'member', prompt: 'Wich member would you like to ban?', - type: 'user', + type: 'member', }, { key: 'reasons', @@ -32,8 +34,13 @@ module.exports = class BanCommand extends Command { reasons = 'Nothing have been specified' if(member.id === message.author.id) return message.say("Why would you ban yourself ?") - await member.send(`https://youtu.be/55-mHgUjZfY\nYou have been banned for the following reasons: "${reasons}"`) - .error(err => console.error(`Could not dm the user, probably disabled\n${err}`)) + + try { + await member.send(`https://youtu.be/55-mHgUjZfY\nYou have been banned for the following reasons: "${reasons}"`) + } catch(err) { + console.error(`Could not dm the user, probably disabled\n${err}`) + } + member.ban(`Banned by : ${message.author.username} for the following reasons : ${reasons}`) .then(() => message.reply(`${member.user.username} was succesfully banned with the following reasons "${reasons}".`)) diff --git a/commands/admin/cb.js b/commands/admin/cb.js index bbc11676..2c53ca4f 100644 --- a/commands/admin/cb.js +++ b/commands/admin/cb.js @@ -1,4 +1,6 @@ const { Command } = require('discord.js-commando'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class cbCommand extends Command { constructor(client) { super(client, { diff --git a/commands/admin/kick.js b/commands/admin/kick.js index df147c8a..5215b673 100644 --- a/commands/admin/kick.js +++ b/commands/admin/kick.js @@ -1,4 +1,6 @@ const { Command } = require('discord.js-commando'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class KickCommand extends Command { constructor(client) { super(client, { diff --git a/commands/admin/prune.js b/commands/admin/prune.js index 38a2d74b..0b75a34f 100644 --- a/commands/admin/prune.js +++ b/commands/admin/prune.js @@ -1,4 +1,6 @@ const { Command } = require('discord.js-commando'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class PruneCommand extends Command { constructor(client) { super(client, { diff --git a/commands/admin/tag.js b/commands/admin/tag.js index 588dbdbc..f0727aef 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -1,6 +1,7 @@ const { Command } = require('discord.js-commando'); const blacklist = require('../../json/blacklist.json'); const fs = require('fs'); + module.exports = class CustomResponseCommand extends Command { constructor(client) { super(client, { diff --git a/commands/admin/unban.js b/commands/admin/unban.js index 9f10beff..6d3f8110 100644 --- a/commands/admin/unban.js +++ b/commands/admin/unban.js @@ -1,4 +1,6 @@ const { Command } = require('discord.js-commando'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class UnbanCommand extends Command { constructor(client) { super(client, { diff --git a/commands/fun/advice.js b/commands/fun/advice.js index 9b1880c6..6ddffa74 100644 --- a/commands/fun/advice.js +++ b/commands/fun/advice.js @@ -2,6 +2,7 @@ const { Command } = require('discord.js-commando'); const Discord = require('discord.js'); const fetch = require('node-fetch') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class AdviceCommand extends Command { diff --git a/commands/fun/badmeme.js b/commands/fun/badmeme.js index 9df9b5e7..0b0a1414 100644 --- a/commands/fun/badmeme.js +++ b/commands/fun/badmeme.js @@ -1,6 +1,7 @@ const { Command } = require('discord.js-commando'); const fetch = require('node-fetch') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class BadMemeCommand extends Command { diff --git a/commands/fun/clap.js b/commands/fun/clap.js index 680b0996..bd9da4f9 100644 --- a/commands/fun/clap.js +++ b/commands/fun/clap.js @@ -1,5 +1,6 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class clapCommand extends Command { constructor(client) { diff --git a/commands/fun/dank.js b/commands/fun/dank.js index 74af0bce..1cd67396 100644 --- a/commands/fun/dank.js +++ b/commands/fun/dank.js @@ -1,6 +1,7 @@ const { Command } = require('discord.js-commando'); const responseObject = require("../../json/randVid.json"); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class dankCommand extends Command { constructor(client) { diff --git a/commands/fun/despacito.js b/commands/fun/despacito.js index 4bd1476e..19511896 100644 --- a/commands/fun/despacito.js +++ b/commands/fun/despacito.js @@ -4,6 +4,7 @@ const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const Discord = require('discord.js'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class DespacitoCommand extends Command { constructor(client) { diff --git a/commands/fun/emotesay.js b/commands/fun/emotesay.js index ce345491..35d97026 100644 --- a/commands/fun/emotesay.js +++ b/commands/fun/emotesay.js @@ -1,6 +1,7 @@ const { Command } = require('discord.js-commando'); const emojiCharacters = require('../../emojiCharacters'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class emoteSayCommand extends Command { constructor(client) { diff --git a/commands/fun/funfact.js b/commands/fun/funfact.js index 6b960e14..7ee3d889 100644 --- a/commands/fun/funfact.js +++ b/commands/fun/funfact.js @@ -1,6 +1,7 @@ const { Command } = require('discord.js-commando'); const responseObject = require("../../json/funfact.json"); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class FunFactCommand extends Command { constructor(client) { diff --git a/commands/fun/ib.js b/commands/fun/ib.js index 6976b514..8118deb4 100644 --- a/commands/fun/ib.js +++ b/commands/fun/ib.js @@ -1,6 +1,7 @@ const { Command } = require('discord.js-commando'); const fetch = require('node-fetch') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class BadMemeCommand extends Command { diff --git a/commands/fun/print.js b/commands/fun/print.js index 789b02cb..7040700f 100644 --- a/commands/fun/print.js +++ b/commands/fun/print.js @@ -2,6 +2,8 @@ const { Command } = require('discord.js-commando'); const printer = require('printer'); const { printChannel } = require('../../config.json'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class printCommand extends Command { constructor(client) { super(client, { diff --git a/commands/fun/reddit.js b/commands/fun/reddit.js index d746ca2d..76754deb 100644 --- a/commands/fun/reddit.js +++ b/commands/fun/reddit.js @@ -3,6 +3,7 @@ const Discord = require('discord.js'); const fetch = require('node-fetch'); const SelfReloadJSON = require('self-reload-json'); const { prefix } = require('../../config.json') +const blacklist = require('../../json/blacklist.json'); module.exports = class redditCommand extends Command { constructor(client) { diff --git a/commands/fun/say.js b/commands/fun/say.js index f5f31968..a4b6c46e 100644 --- a/commands/fun/say.js +++ b/commands/fun/say.js @@ -1,5 +1,6 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class sayCommand extends Command { constructor(client) { diff --git a/commands/fun/sayd.js b/commands/fun/sayd.js index 75ca916e..f2ea2ef7 100644 --- a/commands/fun/sayd.js +++ b/commands/fun/sayd.js @@ -1,5 +1,6 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class saydCommand extends Command { constructor(client) { diff --git a/commands/fun/tts.js b/commands/fun/tts.js index 12bee72e..c8948ef9 100644 --- a/commands/fun/tts.js +++ b/commands/fun/tts.js @@ -3,6 +3,7 @@ const textToSpeech = require('@google-cloud/text-to-speech'); const gclient = new textToSpeech.TextToSpeechClient(); const SelfReloadJSON = require('self-reload-json'); const fs = require('fs'); +const blacklist = require('../../json/blacklist.json'); module.exports = class BadMemeCommand extends Command { diff --git a/commands/fun/ttsvc.js b/commands/fun/ttsvc.js index 47e69263..5041aacd 100644 --- a/commands/fun/ttsvc.js +++ b/commands/fun/ttsvc.js @@ -3,6 +3,7 @@ const textToSpeech = require('@google-cloud/text-to-speech'); const gclient = new textToSpeech.TextToSpeechClient(); const SelfReloadJSON = require('self-reload-json'); const fs = require('fs'); +const blacklist = require('../../json/blacklist.json'); module.exports = class ttsvcCommand extends Command { diff --git a/commands/images/fetish.js b/commands/images/fetish.js index a880c59e..e8a935ca 100644 --- a/commands/images/fetish.js +++ b/commands/images/fetish.js @@ -3,6 +3,8 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + diff --git a/commands/images/god.js b/commands/images/god.js index cc78031e..f8de764d 100644 --- a/commands/images/god.js +++ b/commands/images/god.js @@ -3,6 +3,8 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + diff --git a/commands/images/human.js b/commands/images/human.js index e08ad6db..144a3d4e 100644 --- a/commands/images/human.js +++ b/commands/images/human.js @@ -3,6 +3,8 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + diff --git a/commands/images/idubbbz.js b/commands/images/idubbbz.js index d78f85a7..9b909ced 100644 --- a/commands/images/idubbbz.js +++ b/commands/images/idubbbz.js @@ -3,6 +3,8 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + diff --git a/commands/images/idubbbzpaint.js b/commands/images/idubbbzpaint.js index f78f9bb0..6871b72e 100644 --- a/commands/images/idubbbzpaint.js +++ b/commands/images/idubbbzpaint.js @@ -3,6 +3,8 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + diff --git a/commands/images/like.js b/commands/images/like.js index a60378dd..598a6ca3 100644 --- a/commands/images/like.js +++ b/commands/images/like.js @@ -3,6 +3,7 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); diff --git a/commands/images/ugly.js b/commands/images/ugly.js index f36e0366..d9ffedcc 100644 --- a/commands/images/ugly.js +++ b/commands/images/ugly.js @@ -3,6 +3,7 @@ const Discord = require('discord.js'); const { createCanvas, loadImage, getContext } = require('canvas') const superagent = require('superagent') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); diff --git a/commands/utility/avatar.js b/commands/utility/avatar.js index 26fff88e..f32f57b7 100644 --- a/commands/utility/avatar.js +++ b/commands/utility/avatar.js @@ -1,5 +1,6 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); module.exports = class AvatarCommand extends Command { diff --git a/commands/utility/download.js b/commands/utility/download.js index 800f97f0..40640995 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -3,6 +3,8 @@ const fs = require('fs'); const youtubedl = require('youtube-dl'); const SelfReloadJSON = require('self-reload-json'); const { fbuser, fbpasswd } = require('../../config.json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class downloadCommand extends Command { constructor(client) { diff --git a/commands/utility/feedback.js b/commands/utility/feedback.js index b5f95c3b..20e27e25 100644 --- a/commands/utility/feedback.js +++ b/commands/utility/feedback.js @@ -1,6 +1,8 @@ const { Command } = require('discord.js-commando'); const { feedbackChannel } = require('../../config.json'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + const fs = require('fs'); module.exports = class feedbackCommand extends Command { diff --git a/commands/utility/info.js b/commands/utility/info.js index 453e0d8f..df312584 100644 --- a/commands/utility/info.js +++ b/commands/utility/info.js @@ -2,6 +2,8 @@ const { Command } = require('discord.js-commando'); const Discord = require('discord.js'); const fetch = require('node-fetch') const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class InfoCommand extends Command { constructor(client) { diff --git a/commands/utility/invite.js b/commands/utility/invite.js index 16373433..26247642 100644 --- a/commands/utility/invite.js +++ b/commands/utility/invite.js @@ -1,6 +1,8 @@ const { Command } = require('discord.js-commando'); -const { supportServer } = require('../../config.json') +const { supportServer } = require('../../config.json'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class InviteCommand extends Command { constructor(client) { diff --git a/commands/utility/ping.js b/commands/utility/ping.js index 56486663..93ab48f3 100644 --- a/commands/utility/ping.js +++ b/commands/utility/ping.js @@ -1,6 +1,8 @@ const { oneLine } = require('common-tags'); const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class PingCommand extends Command { constructor(client) { diff --git a/commands/utility/server.js b/commands/utility/server.js index 8f2a4486..bcca82d6 100644 --- a/commands/utility/server.js +++ b/commands/utility/server.js @@ -1,5 +1,7 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class ServerCommand extends Command { constructor(client) { diff --git a/commands/utility/stats.js b/commands/utility/stats.js index 9cbbc118..a15fcf3b 100644 --- a/commands/utility/stats.js +++ b/commands/utility/stats.js @@ -1,5 +1,7 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class statsCommand extends Command { constructor(client) { diff --git a/commands/utility/supportme.js b/commands/utility/supportme.js index 2e1eb6e4..17a81e2f 100644 --- a/commands/utility/supportme.js +++ b/commands/utility/supportme.js @@ -1,5 +1,7 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class supportMeCommand extends Command { constructor(client) { diff --git a/commands/utility/translate.js b/commands/utility/translate.js index bd051982..e1d5c1bf 100644 --- a/commands/utility/translate.js +++ b/commands/utility/translate.js @@ -1,7 +1,7 @@ const { Command } = require('discord.js-commando'); const fetch = require('node-fetch') const SelfReloadJSON = require('self-reload-json'); - +const blacklist = require('../../json/blacklist.json'); const Discord = require('discord.js'); const { yandexAPI } = require('../../config.json'); diff --git a/commands/utility/updoot.js b/commands/utility/updoot.js index 65826db9..11a328b9 100644 --- a/commands/utility/updoot.js +++ b/commands/utility/updoot.js @@ -1,5 +1,7 @@ const { Command } = require('discord.js-commando'); const SelfReloadJSON = require('self-reload-json'); +const blacklist = require('../../json/blacklist.json'); + module.exports = class UpDootCommand extends Command { constructor(client) {