Huge Modification to Code

This commit is contained in:
Daniel Odendahl Jr
2017-03-21 19:20:47 +00:00
parent 65bf037068
commit d49fe32bf6
100 changed files with 1541 additions and 2049 deletions
+9 -8
View File
@@ -1,9 +1,13 @@
const commando = require('discord.js-commando');
class QuantumCoin extends commando.Command {
module.exports = class QuantumCoin extends commando.Command {
constructor(Client){
super(Client, {
name: 'quantumcoin',
name: 'quantumcoin',
aliases: [
'oddcoin',
'brokencoin'
],
group: 'response',
memberName: 'quantumcoin',
description: 'Flips a coin that lands on nothing. (;quantumcoin)',
@@ -11,16 +15,13 @@ class QuantumCoin extends commando.Command {
});
}
async run(message, args) {
async run(message) {
if(message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return;
if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return;
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log("[Command] " + message.content);
let qcoin = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
qcoin = qcoin[Math.floor(Math.random() * qcoin.length)];
message.channel.send("It landed " + qcoin);
}
}
module.exports = QuantumCoin;
};