From b31b00d10866bd4a51b75efec04ceef445c2e301 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 1 Apr 2021 18:58:23 -0400 Subject: [PATCH] Add april fools mode --- .env.example | 3 +++ Xiao.js | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 947a186d..d3674e4b 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,9 @@ XIAO_WEBHOOK_TOKEN= REPORT_CHANNEL_ID= JOIN_LEAVE_CHANNEL_ID= +# Events +APRIL_FOOLS= + # Bot list tokens BOTS_GG_TOKEN= diff --git a/Xiao.js b/Xiao.js index a5d4fe4c..80b2c6f0 100644 --- a/Xiao.js +++ b/Xiao.js @@ -1,5 +1,5 @@ require('dotenv').config(); -const { XIAO_TOKEN, OWNERS, XIAO_PREFIX, INVITE } = process.env; +const { XIAO_TOKEN, OWNERS, XIAO_PREFIX, INVITE, APRIL_FOOLS } = process.env; const path = require('path'); const { Intents, MessageEmbed } = require('discord.js'); const Client = require('./structures/Client'); @@ -332,6 +332,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('You don\'t command me! Try again some other time!'); + return false; +}); + client.on('commandError', (command, err) => client.logger.error(`[COMMAND:${command.name}]\n${err.stack}`)); client.login(XIAO_TOKEN);