Allow/Disallow Cleverbot

This commit is contained in:
Dragon Fire
2021-05-18 16:37:16 -04:00
parent d7be838434
commit 08235698e3
10 changed files with 110 additions and 3 deletions
+30
View File
@@ -0,0 +1,30 @@
const Command = require('../../structures/Command');
module.exports = class AllowCleverbotCommand extends Command {
constructor(client) {
super(client, {
name: 'allow-cleverbot',
aliases: ['allow-clevs'],
group: 'util',
memberName: 'allow-cleverbot',
description: 'Allows a user to use Cleverbot.',
details: 'Only the bot owner(s) may use this command.',
ownerOnly: true,
guarded: true,
args: [
{
key: 'target',
prompt: 'Who do you want to allow? Use the ID.',
type: 'string'
}
]
});
}
async run(msg, { target }) {
if (this.client.allowedUsers.includes(target)) return msg.say(`🧠 \`${target}\` is already allowed.`);
this.client.allowedUsers.push(target);
this.client.exportCleverbotAllowed();
return msg.say(`🧠 Allowed \`${target}\` to use Cleverbot.`);
}
};
+1 -1
View File
@@ -22,7 +22,7 @@ module.exports = class BlacklistCommand extends Command {
},
{
key: 'target',
prompt: 'What do you want to blacklist? Use the ID.',
prompt: 'Who do you want to blacklist? Use the ID.',
type: 'string'
}
]
+31
View File
@@ -0,0 +1,31 @@
const Command = require('../../structures/Command');
const { removeFromArray } = require('../../util/Util');
module.exports = class DisallowCleverbotCommand extends Command {
constructor(client) {
super(client, {
name: 'disallow-cleverbot',
aliases: ['disallow-clevs'],
group: 'util',
memberName: 'disallow-cleverbot',
description: 'Disallows a user from using Cleverbot.',
details: 'Only the bot owner(s) may use this command.',
ownerOnly: true,
guarded: true,
args: [
{
key: 'target',
prompt: 'Who do you want to disallow? Use the ID.',
type: 'string'
}
]
});
}
async run(msg, { target }) {
if (!this.client.allowedUsers.includes(target)) return msg.say(`🧠 \`${target}\` is not allowed.`);
removeFromArray(this.client.allowedUsers, target);
this.client.exportCleverbotAllowed();
return msg.say(`🧠 Disallowed \`${target}\` from using Cleverbot.`);
}
};
+1 -1
View File
@@ -23,7 +23,7 @@ module.exports = class UnblacklistCommand extends Command {
},
{
key: 'target',
prompt: 'What do you want to unblacklist? Use the ID.',
prompt: 'Who do you want to unblacklist? Use the ID.',
type: 'string'
}
]