From 1547eb179842200b83b235b868c3e25368d4ee5a Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 19 Jan 2019 19:11:27 +0100 Subject: [PATCH] Added server blacklist --- event/inhibitors/serverblacklist.js | 16 ++++++++++++++++ event/listeners/commandblocked.js | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 event/inhibitors/serverblacklist.js diff --git a/event/inhibitors/serverblacklist.js b/event/inhibitors/serverblacklist.js new file mode 100644 index 00000000..6a7851fd --- /dev/null +++ b/event/inhibitors/serverblacklist.js @@ -0,0 +1,16 @@ +const { Inhibitor } = require('discord-akairo'); + +class serverblacklistInhibitor extends Inhibitor { + constructor() { + super('serverblacklist', { + reason: 'serverblacklist' + }); + } + + async exec(message) { + const blacklist = []; + return blacklist.includes(message.guild.id); + } +} + +module.exports = serverblacklistInhibitor; \ No newline at end of file diff --git a/event/listeners/commandblocked.js b/event/listeners/commandblocked.js index f3ecd683..8c594a7b 100644 --- a/event/listeners/commandblocked.js +++ b/event/listeners/commandblocked.js @@ -26,6 +26,9 @@ class CommandBlockedListener extends Listener { case 'blacklist': message.reply('You can\'t use this command because you have been blacklisted!'); break; + case 'serverblacklist': + message.reply('You can\'t use this command because the server have been blacklisted!'); + break; } } }