mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +02:00
Add april fools mode
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user