mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add april fools mode
This commit is contained in:
@@ -10,6 +10,9 @@ XIAO_WEBHOOK_TOKEN=
|
||||
REPORT_CHANNEL_ID=
|
||||
JOIN_LEAVE_CHANNEL_ID=
|
||||
|
||||
# Events
|
||||
APRIL_FOOLS=
|
||||
|
||||
# Bot list tokens
|
||||
BOTS_GG_TOKEN=
|
||||
|
||||
|
||||
@@ -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