From fef444242b7b2fb35fdde2dd9eb0d504ffae931b Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 2 May 2021 09:35:20 -0400 Subject: [PATCH] Only no u half the time --- commands/auto/no-u.js | 2 ++ package.json | 2 +- structures/commands/AutoReply.js | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/auto/no-u.js b/commands/auto/no-u.js index fd2a9154..8a04ac31 100644 --- a/commands/auto/no-u.js +++ b/commands/auto/no-u.js @@ -13,6 +13,8 @@ module.exports = class NoUCommand extends Command { } generateText() { + const chance = Boolean(Math.floor(Math.random() * 2)); + if (chance) return null; return 'no u'; } }; diff --git a/package.json b/package.json index 0cb9734c..f52588a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "138.5.0", + "version": "139.0.0", "description": "Your personal server companion.", "main": "Xiao.js", "private": true, diff --git a/structures/commands/AutoReply.js b/structures/commands/AutoReply.js index a7d0e6f5..4641a51b 100644 --- a/structures/commands/AutoReply.js +++ b/structures/commands/AutoReply.js @@ -10,7 +10,9 @@ module.exports = class AutoReplyCommand extends Command { run(msg, args, fromPattern) { if (msg.guild && !msg.channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) return null; - return this.reply ? msg.reply(this.generateText(fromPattern)) : msg.say(this.generateText(fromPattern)); + const text = this.generateText(fromPattern); + if (!text) return null; + return this.reply ? msg.reply(text) : msg.say(text); } generateText() {