mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Add ability to disable auto-reply commands in bot lists
This commit is contained in:
@@ -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?';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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.';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}`;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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 '┬─┬ ノ( ゜-゜ノ)';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user