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
+12 -11
View File
@@ -1,9 +1,13 @@
const commando = require('discord.js-commando');
class FishyCommand extends commando.Command {
module.exports = class FishyCommand extends commando.Command {
constructor(Client){
super(Client, {
name: 'fishy',
name: 'fishy',
aliases: [
'fishing',
'fish'
],
group: 'response',
memberName: 'fishy',
description: 'Catches a fish. (;fishy)',
@@ -11,16 +15,13 @@ class FishyCommand 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 coin = [':fish:', ':tropical_fish:', ':blowfish:'];
coin = coin[Math.floor(Math.random() * coin.length)];
message.channel.send("You caught a: " + coin);
let fish = [':fish:', ':tropical_fish:', ':blowfish:'];
fish = fish[Math.floor(Math.random() * fish.length)];
message.channel.send("You caught a: " + fish);
}
}
module.exports = FishyCommand;
};