1.0.0 • Published 5 years ago
discord-blacklists v1.0.0
Installation
npm i blacklists
Usage
Use this package to simply stop specific users from using your bot commands! Install now!!
Methods
Set
const blacklists = require('blacklists')
module.exports = {
name: 'blacklist',
callback: (message) => {
blacklists.Set(message.mentions.users.first().id)
message.reply('Blacklisted')
}
}
Read
In the Message event(Make sure that you check the message if the command was correct just above the part where u run it with callback run or execute)
const blacklists = require('blacklists')
<client>.on(message, (message) => {
const args = message.content.slice(newPrefix.length).trim().split(/ +/g);
const cmd = args.shift().toLowerCase();
if (cmd.length === 0) return;
const command = <client>.commands.get(cmd) || <client>.aliases.get(cmd)
if (command) {
let check = blacklists.Read(message) // This line is important
if(check = true) { // This one aswell
return message.channel.send('You have been blacklisted') // This is to do whatever you wanna do if the person is blacklisted
}
else {
command.run(message, args)
}
})
Links
1.0.0
5 years ago