From fca3e3012d1d7b1f20ce1d48cdf782e4b72798ea Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 23 May 2021 06:59:24 -0400 Subject: [PATCH] Only add april fools inhibitor if needed --- Xiao.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Xiao.js b/Xiao.js index 1fab0b9e..0e3685a6 100644 --- a/Xiao.js +++ b/Xiao.js @@ -400,13 +400,14 @@ client.dispatcher.addInhibitor(msg => { return false; }); -client.dispatcher.addInhibitor(msg => { - if (APRIL_FOOLS !== 'true') return false; - if (client.isOwner(msg.author)) return false; - const random = Math.floor(Math.random() * 2); - if (random === 1) return msg.reply(aprilFoolsMsgs[Math.floor(Math.random() * aprilFoolsMsgs.length)]); - return false; -}); +if (APRIL_FOOLS) { + client.dispatcher.addInhibitor(msg => { + if (client.isOwner(msg.author)) return false; + const random = Math.floor(Math.random() * 2); + if (random === 1) return msg.reply(aprilFoolsMsgs[Math.floor(Math.random() * aprilFoolsMsgs.length)]); + return false; + }); +} client.on('commandError', (command, err) => client.logger.error(`[COMMAND:${command.name}]\n${err.stack}`));