Add april fools mode

This commit is contained in:
Dragon Fire
2021-04-01 18:58:23 -04:00
parent 89664bb620
commit b31b00d108
2 changed files with 12 additions and 1 deletions
+3
View File
@@ -10,6 +10,9 @@ XIAO_WEBHOOK_TOKEN=
REPORT_CHANNEL_ID=
JOIN_LEAVE_CHANNEL_ID=
# Events
APRIL_FOOLS=
# Bot list tokens
BOTS_GG_TOKEN=
+9 -1
View File
@@ -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);