2019-03-31 19:17:50 +02:00
|
|
|
const { Listener } = require('discord-akairo');
|
|
|
|
|
|
|
|
class commandStartedListener extends Listener {
|
|
|
|
constructor() {
|
|
|
|
super('commandStarted', {
|
|
|
|
emitter: 'commandHandler',
|
|
|
|
event: 'commandStarted'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async exec(message) {
|
2019-03-31 17:31:47 +02:00
|
|
|
//This is for april fools
|
|
|
|
let today = new Date();
|
|
|
|
let dd = today.getDate();
|
|
|
|
let mm = today.getMonth() + 1; //January is 0!
|
|
|
|
|
|
|
|
if (dd < 10) {
|
|
|
|
dd = '0' + dd;
|
|
|
|
}
|
|
|
|
if (mm < 10) {
|
|
|
|
mm = '0' + mm;
|
|
|
|
}
|
|
|
|
today = dd + '/' + mm;
|
|
|
|
//Only execute when its april first
|
|
|
|
if (today == '01/04') {
|
|
|
|
let count = Math.random() * 100;
|
2019-04-01 00:06:34 +02:00
|
|
|
if (count < 10) {
|
2019-03-31 20:38:54 +02:00
|
|
|
console.log('Gold triggered!');
|
2019-03-31 20:41:19 +02:00
|
|
|
this.client.user.setActivity('people buy haha yes gold™', { type: 'WATCHING' });
|
2019-03-31 17:31:47 +02:00
|
|
|
return message.channel.send('To further utilize this command, please visit https://namejeff.xyz/gold', {files: ['img/gold.png']});
|
|
|
|
}
|
2019-03-31 19:17:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = commandStartedListener;
|