Add ability to disable auto-reply commands in bot lists

This commit is contained in:
Dragon Fire
2020-04-11 11:15:27 -04:00
parent 6d02ac1dca
commit 6169f79125
12 changed files with 50 additions and 21 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
const Command = require('../../structures/Command');
const Command = require('../../structures/commands/AutoReply');
module.exports = class CanYouNotCommand extends Command {
constructor(client) {
@@ -8,11 +8,12 @@ module.exports = class CanYouNotCommand extends Command {
group: 'auto',
memberName: 'can-you-not',
description: 'Can YOU not?',
patterns: [/can (you|u) not/i]
patterns: [/can (you|u) not/i],
reply: true
});
}
run(msg) {
return msg.reply('Can YOU not?');
generateText() {
return 'Can YOU not?';
}
};
+3 -3
View File
@@ -1,4 +1,4 @@
const Command = require('../../structures/Command');
const Command = require('../../structures/commands/AutoReply');
module.exports = class KazumaKazumaCommand extends Command {
constructor(client) {
@@ -18,7 +18,7 @@ module.exports = class KazumaKazumaCommand extends Command {
});
}
run(msg) {
return msg.say('Hai, Kazuma desu.');
generateText() {
return 'Hai, Kazuma desu.';
}
};
+3 -3
View File
@@ -1,4 +1,4 @@
const Command = require('../../structures/Command');
const Command = require('../../structures/commands/AutoReply');
module.exports = class NoUCommand extends Command {
constructor(client) {
@@ -12,7 +12,7 @@ module.exports = class NoUCommand extends Command {
});
}
run(msg) {
return msg.say('no u');
generateText() {
return 'no u';
}
};
+5 -4
View File
@@ -1,4 +1,4 @@
const Command = require('../../structures/Command');
const Command = require('../../structures/commands/AutoReply');
module.exports = class SuicideHotlineCommand extends Command {
constructor(client) {
@@ -9,6 +9,7 @@ module.exports = class SuicideHotlineCommand extends Command {
memberName: 'suicide-hotline',
description: 'Responds with the phone number for the Suicide Hotline.',
patterns: [/\bkms\b/i, /\b(kill myself)\b/i, /<:kms:(.+)>/i],
reply: true,
credit: [
{
name: 'National Suicide Prevention Lifeline',
@@ -19,9 +20,9 @@ module.exports = class SuicideHotlineCommand extends Command {
});
}
run(msg, args, fromPattern) {
generateText(fromPattern) {
const text = 'Call 1-800-273-8255 for the National Suicide Prevention Lifeline.';
if (!fromPattern) return msg.say(text);
return msg.reply(`Don't say that. Get help. ${text}`);
if (!fromPattern) text;
return `Don't say that. Get help. ${text}`;
}
};
+3 -3
View File
@@ -1,4 +1,4 @@
const Command = require('../../structures/Command');
const Command = require('../../structures/commands/AutoReply');
module.exports = class UnflipCommand extends Command {
constructor(client) {
@@ -11,7 +11,7 @@ module.exports = class UnflipCommand extends Command {
});
}
run(msg) {
return msg.say('┬─┬ ( ゜-゜ノ)');
generateText() {
return '┬─┬ ( ゜-゜ノ)';
}
};
+4 -1
View File
@@ -35,7 +35,10 @@ module.exports = class CleverbotCommand extends Command {
}
async run(msg, { text }, fromPattern) {
if (fromPattern) text = msg.patternMatches[2];
if (fromPattern) {
if (this.client.botListGuilds.includes(msg.guild.id)) return null;
text = msg.patternMatches[2];
}
try {
const convo = this.convos.get(msg.channel.id);
const { body } = await request
+1
View File
@@ -17,6 +17,7 @@ module.exports = class UnknownCommandCommand extends Command {
run(msg) {
if (msg.channel.type !== 'text') return null;
if (this.client.botListGuilds.includes(msg.guild.id)) return null;
const commands = this.makeCommandArray(this.client.isOwner(msg.author), msg.channel.nsfw);
const command = msg.content.match(this.client.dispatcher._commandPatterns[this.client.commandPrefix]);
const str = command ? command[2] : msg.content.split(' ')[0];