From d49fe32bf6214ba506c74ba6a4d6d0845c81e424 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 21 Mar 2017 19:20:47 +0000 Subject: [PATCH] Huge Modification to Code --- commands/avataredit/3000years.js | 29 +- commands/avataredit/beautiful.js | 29 +- commands/avataredit/bobross.js | 30 +- commands/avataredit/rip.js | 30 +- commands/avataredit/steamcard.js | 34 +- commands/botinfo/contact.js | 22 +- commands/botinfo/info.js | 28 +- commands/botinfo/invite.js | 15 +- commands/botinfo/uptime.js | 16 +- commands/guildinfo/emoji.js | 25 +- commands/guildinfo/guildinfo.js | 25 +- commands/imageedit/meme.js | 25 +- commands/moderation/ban.js | 46 +- commands/moderation/kick.js | 43 +- commands/moderation/warn.js | 36 +- commands/numedit/math.js | 23 +- commands/numedit/roman.js | 19 +- commands/random/canyounot.js | 13 +- commands/random/giveflower.js | 17 +- commands/random/lenny.js | 13 +- commands/random/lottery.js | 19 +- commands/random/mathgame.js | 14 +- commands/random/nitro.js | 14 +- commands/random/slowclap.js | 13 +- commands/random/soundboard.js | 23 +- commands/random/spam.js | 15 +- commands/random/today.js | 36 +- commands/random/typinggame.js | 14 +- commands/response/8ball.js | 19 +- commands/response/cat.js | 16 +- commands/response/choose.js | 16 +- commands/response/coin.js | 17 +- commands/response/compliment.js | 25 +- commands/response/factcore.js | 19 +- commands/response/fishy.js | 23 +- commands/response/fortune.js | 16 +- commands/response/motivate.js | 27 +- commands/response/name.js | 41 +- commands/response/offspring.js | 18 +- commands/response/potato.js | 12 +- commands/response/pun.js | 14 +- commands/response/quantumcoin.js | 17 +- commands/response/ratewaifu.js | 20 +- commands/response/roast.js | 28 +- commands/response/rockpaperscissors.js | 16 +- commands/response/roll.js | 19 +- commands/response/roulette.js | 25 +- commands/response/ship.js | 20 +- commands/response/slots.js | 13 +- commands/response/vocaloid.js | 22 +- commands/response/xiaopai.js | 17 +- commands/roleplay/cuddle.js | 17 +- commands/roleplay/divorce.js | 17 +- commands/roleplay/eat.js | 17 +- commands/roleplay/falconpunch.js | 17 +- commands/roleplay/fistbump.js | 17 +- commands/roleplay/highfive.js | 17 +- commands/roleplay/hitwithshovel.js | 17 +- commands/roleplay/hug.js | 17 +- commands/roleplay/inhales.js | 17 +- commands/roleplay/kill.js | 17 +- commands/roleplay/kiss.js | 17 +- commands/roleplay/marries.js | 17 +- commands/roleplay/pat.js | 17 +- commands/roleplay/poke.js | 17 +- commands/roleplay/punch.js | 17 +- commands/roleplay/slap.js | 17 +- commands/search/botinfo.js | 45 +- commands/search/define.js | 45 +- commands/search/discrim.js | 18 +- commands/search/forecast.js | 21 +- commands/search/imdb.js | 25 +- commands/search/neopet.js | 24 +- commands/search/osu.js | 38 +- commands/search/pkdex.json | 1270 ++++++++++-------------- commands/search/pokedex.js | 23 +- commands/search/urban.js | 42 +- commands/search/wattpad.js | 54 +- commands/search/weather.js | 18 +- commands/search/wikipedia.js | 39 +- commands/search/youtube.js | 50 +- commands/search/yugioh.js | 49 +- commands/textedit/binary.js | 13 +- commands/textedit/cowsay.js | 13 +- commands/textedit/embed.js | 20 +- commands/textedit/morse.js | 16 +- commands/textedit/pirate.js | 23 +- commands/textedit/reverse.js | 22 +- commands/textedit/rin.js | 35 +- commands/textedit/romaji.js | 16 +- commands/textedit/say.js | 24 +- commands/textedit/shuffle.js | 29 +- commands/textedit/translate.js | 30 +- commands/textedit/yoda.js | 39 +- commands/textedit/zalgo.js | 13 +- commands/userinfo/avatar.js | 17 +- commands/userinfo/userinfo.js | 32 +- commands/util/servers.js | 16 +- index.js | 70 +- package.json | 3 +- 100 files changed, 1541 insertions(+), 2049 deletions(-) diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index 85800455..65278162 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -1,10 +1,13 @@ const commando = require('discord.js-commando'); const Jimp = require("jimp"); -class YearsCommand extends commando.Command { +module.exports = class YearsCommand extends commando.Command { constructor(Client){ super(Client, { - name: '3000years', + name: '3000years', + aliases: [ + 'az' + ], group: 'avataredit', memberName: '3000years', description: "It's been 3000 years... (;3000years @User)", @@ -12,24 +15,22 @@ class YearsCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if(message.mentions.users.first().avatarURL === null) { - message.channel.send(":x: This person has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { - let avatarurl = message.mentions.users.first().avatarURL; - avatarurl = avatarurl.replace(".jpg", ".png"); - avatarurl = avatarurl.replace(".gif", ".png"); + let userAvatar = message.mentions.users.first().avatarURL; + userAvatar = userAvatar.replace(".jpg", ".png"); + userAvatar = userAvatar.replace(".gif", ".png"); let images = []; - images.push(Jimp.read(avatarurl)); + images.push(Jimp.read(userAvatar)); images.push(Jimp.read("./images/3000years.png")); Promise.all(images).then(([avatar, years]) => { avatar.resize(200, 200); @@ -42,6 +43,4 @@ class YearsCommand extends commando.Command { } } } -} - -module.exports = YearsCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index a5b56b0e..b6220ad2 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -1,10 +1,13 @@ const commando = require('discord.js-commando'); const Jimp = require("jimp"); -class BeautifulCommand extends commando.Command { +module.exports = class BeautifulCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'beautiful', + name: 'beautiful', + aliases: [ + 'grunklestan' + ], group: 'avataredit', memberName: 'beautiful', description: 'Oh, this? This is beautiful. (;beautiful @User)', @@ -12,24 +15,22 @@ class BeautifulCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if(message.mentions.users.first().avatarURL === null) { - message.channel.send(":x: This person has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { - let avatarurl = message.mentions.users.first().avatarURL; - avatarurl = avatarurl.replace(".jpg", ".png"); - avatarurl = avatarurl.replace(".gif", ".png"); + let userAvatar = message.mentions.users.first().avatarURL; + userAvatar = userAvatar.replace(".jpg", ".png"); + userAvatar = userAvatar.replace(".gif", ".png"); let images = []; - images.push(Jimp.read(avatarurl)); + images.push(Jimp.read(userAvatar)); images.push(Jimp.read("./images/beautiful.jpg")); Promise.all(images).then(([avatar, beautiful]) => { avatar.resize(200, 200); @@ -44,6 +45,4 @@ class BeautifulCommand extends commando.Command { } } } -} - -module.exports = BeautifulCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index 6d11b16c..3ee8add6 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -1,10 +1,14 @@ const commando = require('discord.js-commando'); const Jimp = require("jimp"); -class BobRossCommand extends commando.Command { +module.exports = class BobRossCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'bobross', + name: 'bobross', + aliases: [ + 'bob', + 'ross' + ], group: 'avataredit', memberName: 'bobross', description: "Make Bob Ross draw your avatar. (;bobross @User)", @@ -12,24 +16,22 @@ class BobRossCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if(message.mentions.users.first().avatarURL === null) { - message.channel.send(":x: This person has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { - let avatarurl = message.mentions.users.first().avatarURL; - avatarurl = avatarurl.replace(".jpg", ".png"); - avatarurl = avatarurl.replace(".gif", ".png"); + let userAvatar = message.mentions.users.first().avatarURL; + userAvatar = userAvatar.replace(".jpg", ".png"); + userAvatar = userAvatar.replace(".gif", ".png"); let images = []; - images.push(Jimp.read(avatarurl)); + images.push(Jimp.read(userAvatar)); images.push(Jimp.read("./images/BobRoss.png")); images.push(Jimp.read("./images/BlankWhite.png")); Promise.all(images).then(([avatar, bob, nothing]) => { @@ -45,6 +47,4 @@ class BobRossCommand extends commando.Command { } } } -} - -module.exports = BobRossCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index 09468f59..c21b717d 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -1,10 +1,14 @@ const commando = require('discord.js-commando'); const Jimp = require("jimp"); -class RIPCommand extends commando.Command { +module.exports = class RIPCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'rip', + name: 'rip', + aliases: [ + 'grave', + 'gravestone' + ], group: 'avataredit', memberName: 'rip', description: 'Puts a profile picture over a gravestone. (;rip @User)', @@ -12,24 +16,22 @@ class RIPCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if(message.mentions.users.first().avatarURL === null) { - message.channel.send(":x: This person has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { - let avatarurl = message.mentions.users.first().avatarURL; - avatarurl = avatarurl.replace(".jpg", ".png"); - avatarurl = avatarurl.replace(".gif", ".png"); + let userAvatar = message.mentions.users.first().avatarURL; + userAvatar = userAvatar.replace(".jpg", ".png"); + userAvatar = userAvatar.replace(".gif", ".png"); let images = []; - images.push(Jimp.read(avatarurl)); + images.push(Jimp.read(userAvatar)); images.push(Jimp.read("./images/gravestone.jpg")); Promise.all(images).then(([avatar, gravestone]) => { avatar.resize(200, 200); @@ -42,6 +44,4 @@ class RIPCommand extends commando.Command { } } } -} - -module.exports = RIPCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index d06cce1b..15d8e1e9 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -1,10 +1,14 @@ const commando = require('discord.js-commando'); const Jimp = require("jimp"); -class SteamCardCommand extends commando.Command { +module.exports = class SteamCardCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'steamcard', + name: 'steamcard', + aliases: [ + 'steam', + 'card' + ], group: 'avataredit', memberName: 'steamcard', description: "Put an avatar on a Steam Card. (;steamcard @User)", @@ -12,26 +16,24 @@ class SteamCardCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); if(message.channel.type !== 'dm') { if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if(message.mentions.users.first().avatarURL === null) { - message.channel.send(":x: This person has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { - let userdisplayname = message.guild.member(message.mentions.users.first()).displayName; - let avatarurl = message.mentions.users.first().avatarURL; - avatarurl = avatarurl.replace(".jpg", ".png"); - avatarurl = avatarurl.replace(".gif", ".png"); + let userDisplayName = message.guild.member(message.mentions.users.first()).displayName; + let userAvatar = message.mentions.users.first().avatarURL; + userAvatar = userAvatar.replace(".jpg", ".png"); + userAvatar = userAvatar.replace(".gif", ".png"); let images = []; - images.push(Jimp.read(avatarurl)); + images.push(Jimp.read(userAvatar)); images.push(Jimp.read("./images/SteamCard.png")); images.push(Jimp.read("./images/SteamCardBlank.png")); Promise.all(images).then(([avatar, steamcard, nothing]) => { @@ -39,7 +41,7 @@ class SteamCardCommand extends commando.Command { avatar.resize(450, 450); nothing.composite(avatar, 25, 25); nothing.composite(steamcard, 0, 0); - nothing.print(font, 38, 20, userdisplayname); + nothing.print(font, 38, 20, userDisplayName); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) throw err; message.channel.sendFile(buff); @@ -52,6 +54,4 @@ class SteamCardCommand extends commando.Command { message.channel.send(':x: Error! This command does not work in DM!'); } } -} - -module.exports = SteamCardCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/botinfo/contact.js b/commands/botinfo/contact.js index a1c8ec8c..99fd0217 100644 --- a/commands/botinfo/contact.js +++ b/commands/botinfo/contact.js @@ -1,10 +1,15 @@ const commando = require('discord.js-commando'); const banlist = require('./banlist.json'); -class ContactCommand extends commando.Command { +module.exports = class ContactCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'contact', + name: 'contact', + aliases: [ + 'suggest', + 'report', + 'bug' + ], group: 'botinfo', memberName: 'contact', description: 'Report bugs or request new features. (;contact Fix this command!)', @@ -12,20 +17,17 @@ class ContactCommand 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 banid = message.author.id; - if (message.author.id === banlist.banned[banid]) { + let banID = message.author.id; + if (message.author.id === banlist.banned[banID]) { message.channel.send("Sorry, you've been banned from using this command."); } else { this.client.users.get('242699360352206850').send("**" + message.author.username + '#' + message.author.discriminator + " (" + message.author.id + ")" + ":**\n" + message.content.split(" ").slice(1).join(" ")); message.channel.send('Message Sent! Thanks for your support!'); } } -} - -module.exports = ContactCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/botinfo/info.js b/commands/botinfo/info.js index 0788180e..1d57cdc2 100644 --- a/commands/botinfo/info.js +++ b/commands/botinfo/info.js @@ -4,10 +4,14 @@ const config = require("../../config.json"); const moment = require('moment'); require('moment-duration-format'); -class InfoCommand extends commando.Command { +module.exports = class InfoCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'info', + name: 'info', + aliases: [ + 'data', + 'information' + ], group: 'botinfo', memberName: 'info', description: 'Gives some bot info. (;info)', @@ -15,16 +19,12 @@ class InfoCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let guilds = this.client.guilds.size; - let users = this.client.users.size; - this.client.shard.fetchClientValues('guilds.size').then(results => { + this.client.shard.fetchClientValues('guilds.size').then(guilds => { this.client.shard.fetchClientValues('voiceConnections.size').then(vCConnections => { const embed = new Discord.RichEmbed() .setTitle('Welcome to XiaoBot!') @@ -37,11 +37,11 @@ class InfoCommand extends commando.Command { .addField('Commands', "There are a variety of commands XiaoBot can use! Use ';help' to view a list of all commands!") .addField('Servers', - guilds + "/" + results.reduce((prev, val) => prev + val, 0), true) + this.client.guilds.size + " / " + guilds.reduce((prev, val) => prev + val, 0), true) .addField('Shards', this.client.options.shardCount + " (This is Shard: " + this.client.shard.id + ")", true) .addField('Commands', - config.commandcount, true) + config.commandCount, true) .addField('Owner', "dragonfire535#8081", true) .addField('Source Code', @@ -53,7 +53,7 @@ class InfoCommand extends commando.Command { .addField('Node Version', process.version, true) .addField('Voice Connections', - this.client.voiceConnections.size + "/" + vCConnections.reduce((prev, val) => prev + val, 0), true) + this.client.voiceConnections.size + " / " + vCConnections.reduce((prev, val) => prev + val, 0), true) .addField('Library', "[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)", true) .addField('Modules', @@ -72,6 +72,4 @@ class InfoCommand extends commando.Command { }); }); } -} - -module.exports = InfoCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/botinfo/invite.js b/commands/botinfo/invite.js index 14c380c5..a100adfd 100644 --- a/commands/botinfo/invite.js +++ b/commands/botinfo/invite.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class InviteCommand extends commando.Command { +module.exports = class InviteCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'invite', + name: 'invite', group: 'botinfo', memberName: 'invite', description: 'Sends you an invite for the bot, or an invite to my server, Heroes of Dreamland. (;invite)', @@ -11,14 +11,11 @@ class InviteCommand 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); - message.channel.send("\nAdd me to your server with this link:\n" + "https://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343" + "\nOr, come to my server with this link:\n" + "https://discord.gg/fqQF8mc"); + message.channel.send("Add me to your server with this link:\nhttps://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343\nOr, come to my server with this link:\nhttps://discord.gg/fqQF8mc"); } -} - -module.exports = InviteCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/botinfo/uptime.js b/commands/botinfo/uptime.js index ff891383..3ccc5fde 100644 --- a/commands/botinfo/uptime.js +++ b/commands/botinfo/uptime.js @@ -2,10 +2,10 @@ const commando = require('discord.js-commando'); const moment = require('moment'); require('moment-duration-format'); -class UptimeCommand extends commando.Command { +module.exports = class UptimeCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'uptime', + name: 'uptime', group: 'botinfo', memberName: 'uptime', description: 'Displays how long the bot has been active. (;uptime)', @@ -13,15 +13,11 @@ class UptimeCommand 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 guilds = this.client.guilds.array().length; - message.channel.send("I've been active on this shard for: **" + moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]') + "** in a total of " + guilds + " Servers."); + message.channel.send("I've been active on this shard for: **" + moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]') + "** in a total of " + this.client.guilds.size + " Servers."); } -} - -module.exports = UptimeCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/guildinfo/emoji.js b/commands/guildinfo/emoji.js index 9174f05a..d30b6359 100644 --- a/commands/guildinfo/emoji.js +++ b/commands/guildinfo/emoji.js @@ -1,9 +1,14 @@ const commando = require('discord.js-commando'); -class EmojiCommand extends commando.Command { +module.exports = class EmojiCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'emoji', + name: 'emoji', + aliases: [ + 'emoticons', + 'emojilist', + 'emoticonlist' + ], group: 'guildinfo', memberName: 'emoji', description: "Gives a list of the current server's emoji. (;emoji)", @@ -11,19 +16,15 @@ class EmojiCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - if (message.channel.type === 'dm') { - message.channel.send(":x: This is a DM!"); - } else { + if (message.channel.type !== 'dm') { message.channel.send(message.guild.emojis.map(e => e).join(" ")); + } else { + message.channel.send(":x: Error! This command does not work in DM!"); } } -} - -module.exports = EmojiCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/guildinfo/guildinfo.js b/commands/guildinfo/guildinfo.js index 9f98cf4d..ec997017 100644 --- a/commands/guildinfo/guildinfo.js +++ b/commands/guildinfo/guildinfo.js @@ -1,10 +1,15 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class GuildInfoCommand extends commando.Command { +module.exports = class GuildInfoCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'server', + name: 'server', + aliases: [ + 'guild', + 'serverinfo', + 'guildinfo' + ], group: 'guildinfo', memberName: 'server', description: 'Gives some info on the current server. (;server)', @@ -12,16 +17,12 @@ class GuildInfoCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - if (message.channel.type === 'dm') { - message.channel.send(":x: This is a DM!"); - } else { + if (message.channel.type !== 'dm') { const embed = new Discord.RichEmbed() .setColor(0x00AE86) .setThumbnail(message.guild.iconURL) @@ -40,8 +41,8 @@ class GuildInfoCommand extends commando.Command { .addField("**Users:**", message.guild.memberCount, true); message.channel.sendEmbed(embed).catch(console.error); + } else { + message.channel.send(":x: Error! This command does not work in DM!"); } } -} - -module.exports = GuildInfoCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/imageedit/meme.js b/commands/imageedit/meme.js index 21cbdea6..4598366c 100644 --- a/commands/imageedit/meme.js +++ b/commands/imageedit/meme.js @@ -1,10 +1,13 @@ const commando = require('discord.js-commando'); const memecodes = require('./memecodes.json'); -class MemeCommand extends commando.Command { +module.exports = class MemeCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'meme', + name: 'meme', + aliases: [ + 'memegen' + ], group: 'imageedit', memberName: 'meme', description: "Sends a Meme with text of your choice, and a background of your choice. Split first and second lines with a | (;meme facepalm I can't even | comprehend this)", @@ -12,11 +15,9 @@ class MemeCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); let [type] = message.content.toLowerCase().split(" ").slice(1); @@ -26,9 +27,9 @@ class MemeCommand extends commando.Command { if(message.content.split(" ").slice(1).join(" ").match(/^[a-zA-Z0-9|.,!?'-\s]+$/)) { let bottomrow = message.content.toLowerCase().split("|").slice(1).join("-"); let toprow = " " + message.content.toLowerCase().replace(bottomrow, "").split(" ").slice(2).join("-"); - toprow = toprow.replace("|", ""); - bottomrow = bottomrow.replace("?", "~q"); - toprow = toprow.replace("?", "~q"); + toprow = toprow.split("|").join(""); + bottomrow = bottomrow.split("?").join("~q"); + toprow = toprow.split("?").join("~q"); let link = "https://memegen.link/" + type + "/" + toprow + "/" + bottomrow + ".jpg"; if(bottomrow.length > 100) { message.channel.send(":x: Error! Bottom text is over 100 characters!"); @@ -38,7 +39,7 @@ class MemeCommand extends commando.Command { if(memecodes.memecodes[type]) { message.channel.sendFile(link).catch(error => message.channel.send(":x: An Error Occurred! Please try again later!")); } else { - message.channel.send(":x: Error! Meme type not found! (View list with ;meme list)"); + message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!"); } } } else { @@ -48,6 +49,4 @@ class MemeCommand extends commando.Command { message.channel.send(":x: Split your two choices with a ' | '!"); } } -} - -module.exports = MemeCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 4f362785..50431c73 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -1,59 +1,55 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class BanCommand extends commando.Command { +module.exports = class BanCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'ban', + name: 'ban', + aliases: [ + 'banne' + ], group: 'moderation', memberName: 'ban', - description: 'Bans a user. (;ban @User being a jerk. **Note: You must have a channel called "mod_logs!"**)', - examples: [";ban @User being a jerk. **Note: You must have a channel called 'mod_logs!**"] + description: 'Bans a user. (;ban @User being a jerk.)', + examples: [";ban @User being a jerk."] }); } - 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('EMBED_LINKS')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('KICK_MEMBERS')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return; } console.log("[Command] " + message.content); - if (message.channel.type === 'dm') { - message.channel.send(":x: This is a DM!"); - } else { - let username = message.mentions.users.first(); - let member = message.guild.member(message.mentions.users.first()); + if (message.channel.type !== 'dm') { + let userToBan = message.mentions.users.first(); let reason = message.content.split(" ").slice(2).join(" "); if (message.mentions.users.size !== 1) { - message.channel.send(":x: Either too many or no members, only mention one person!"); + message.channel.send(":x: Error! Please mention one user!"); } else { if(message.member.hasPermission('BAN_MEMBERS')) { - if(member.bannable === true) { + if(message.guild.member(userToBan).bannable) { message.channel.send(":ok_hand:"); - message.guild.member(username).ban(); + message.guild.member(userToBan).ban(); if(message.guild.channels.exists("name", "mod_logs")) { const embed = new Discord.RichEmbed() .setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL) .setColor(0xFF0000) .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() - .setDescription('**Member:** ' + username.username + '#' + username.discriminator + ' (' + username.id + ')\n**Action:** Ban\n**Reason:** ' + reason); + .setDescription('**Member:** ' + userToBan.username + '#' + userToBan.discriminator + ' (' + userToBan.id + ')\n**Action:** Ban\n**Reason:** ' + reason); message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); } else { - message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**"); + message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**"); } } else { - message.channel.send(":x: This member cannot be banned!"); + message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?"); } } else { - message.channel.send(":x: You don't have the Ban Members Permission!"); + message.channel.send(":x: Error! You don't have the Ban Members Permission!"); } } + } else { + message.channel.send(":x: Error! This command does not work in DM!"); } } -} - -module.exports = BanCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 6569d2b6..f41d7350 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -1,59 +1,52 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class KickCommand extends commando.Command { +module.exports = class KickCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'kick', + name: 'kick', group: 'moderation', memberName: 'kick', - description: 'Kicks a user. (;kick @User being a jerk **Note: You must have a channel called "mod_logs!"**)', - examples: [";kick @User being a jerk. **Note: You must have a channel called 'mod_logs!**"] + description: 'Kicks a user. (;kick @User being a jerk.)', + examples: [";kick @User being a jerk."] }); } - 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('EMBED_LINKS')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('KICK_MEMBERS')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'KICK_MEMBERS'])) return; } console.log("[Command] " + message.content); - if (message.channel.type === 'dm') { - message.channel.send(":x: This is a DM!"); - } else { - let username = message.mentions.users.first(); - let member = message.guild.member(message.mentions.users.first()); + if (message.channel.type !== 'dm') { + let userToKick = message.mentions.users.first(); let reason = message.content.split(" ").slice(2).join(" "); if (message.mentions.users.size !== 1) { - message.channel.send(":x: Either too many or no members, only mention one person!"); + message.channel.send(":x: Error! Please mention one user!"); } else { if(message.member.hasPermission('KICK_MEMBERS')) { - if(member.kickable === true) { + if(message.guild.member(userToKick).kickable) { message.channel.send(":ok_hand:"); - message.guild.member(username).kick(); + message.guild.member(userToKick).kick(); if(message.guild.channels.exists("name", "mod_logs")) { const embed = new Discord.RichEmbed() .setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL) .setColor(0xFFA500) .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() - .setDescription('**Member:** ' + username.username + '#' + username.discriminator + ' (' + username.id + ')\n**Action:** Kick\n**Reason:** ' + reason); + .setDescription('**Member:** ' + userToKick.username + '#' + userToKick.discriminator + ' (' + userToKick.id + ')\n**Action:** Kick\n**Reason:** ' + reason); message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); } else { - message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**"); + message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**"); } } else { - message.channel.send(":x: This member cannot be kicked!"); + message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?"); } } else { - message.channel.send(":x: You don't have the Kick Members Permission!"); + message.channel.send(":x: Error! You don't have the Kick Members Permission!"); } } + } else { + message.channel.send(":x: Error! This command does not work in DM!"); } } -} - -module.exports = KickCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 975a5bab..bb0a2e9f 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -1,35 +1,29 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class WarnCommand extends commando.Command { +module.exports = class WarnCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'warn', + name: 'warn', group: 'moderation', memberName: 'warn', - description: 'Warns a user. (;warn @User being a jerk **Note: You must have a channel called "mod_logs!"**)', - examples: [";warn @User being a jerk. **Note: You must have a channel called 'mod_logs!**"] + description: 'Warns a user. (;warn @User being a jerk)', + examples: [";warn @User being a jerk."] }); } - 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('EMBED_LINKS')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('KICK_MEMBERS')) return; - if(!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - if (message.channel.type === 'dm') { - message.channel.send(":x: This is a DM!"); + if (message.channel.type !== 'dm') { + message.channel.send(":x: Error! This command does not work in DM!"); } else { - let username = message.mentions.users.first(); + let userToWarn = message.mentions.users.first(); let reason = message.content.split(" ").slice(2).join(" "); if (message.mentions.users.size !== 1) { - message.channel.send(":x: Either too many or no members, only mention one person!"); - } else { - if(message.member.hasPermission('KICK_MEMBERS')) { + if(message.member.hasPermission('MANAGE_MESSAGES')) { message.channel.send(":ok_hand:"); if(message.guild.channels.exists("name", "mod_logs")) { const embed = new Discord.RichEmbed() @@ -37,17 +31,17 @@ class WarnCommand extends commando.Command { .setColor(0xFFFF00) .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() - .setDescription('**Member:** ' + username.username + '#' + username.discriminator + ' (' + username.id + ')\n**Action:** Warn\n**Reason:** ' + reason); + .setDescription('**Member:** ' + userToWarn.username + '#' + userToWarn.discriminator + ' (' + userToWarn.id + ')\n**Action:** Warn\n**Reason:** ' + reason); message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); } else { message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**"); } } else { - message.channel.send(":x: You don't have the Kick Members Permission!"); + message.channel.send(":x: Error! You don't have the Manage Messages Permission!"); } + } else { + message.channel.send(":x: Error! Please mention one user!"); } } } -} - -module.exports = WarnCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/numedit/math.js b/commands/numedit/math.js index fcde8796..3bdc6c0e 100644 --- a/commands/numedit/math.js +++ b/commands/numedit/math.js @@ -1,10 +1,16 @@ const commando = require('discord.js-commando'); const math = require('mathjs'); -class MathCommand extends commando.Command { +module.exports = class MathCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'math', + name: 'math', + aliases: [ + 'add', + 'subtract', + 'multiply', + 'divide' + ], group: 'numedit', memberName: 'math', description: 'Does Math (;math 2 + 2)', @@ -12,20 +18,17 @@ class MathCommand 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 messagecontent = message.content.split(" ").slice(1).join(" "); + let expression = message.content.split(" ").slice(1).join(" "); try { - let solved = math.eval(messagecontent); + let solved = math.eval(expression); message.channel.send(solved).catch(error => message.channel.send(":x: Error! Invalid statement!")); } catch(err) { message.channel.send(":x: Error! Invalid statement!"); } } -} - -module.exports = MathCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/numedit/roman.js b/commands/numedit/roman.js index 6418bd65..5ffb46fe 100644 --- a/commands/numedit/roman.js +++ b/commands/numedit/roman.js @@ -1,7 +1,7 @@ const commando = require('discord.js-commando'); const romanNumeralConverter = require('roman-numeral-converter-mmxvi'); -class RomanCommand extends commando.Command { +module.exports = class RomanCommand extends commando.Command { constructor(Client){ super(Client, { name: 'roman', @@ -12,20 +12,17 @@ class RomanCommand 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 messagecontent = message.content.split(" ").slice(1).join(" "); - let numberified = Number(messagecontent); - if(numberified > 1000000) { + let numberToRoman = message.content.split(" ").slice(1).join(" "); + let romanInterger = Number(numberToRoman); + if(romanInterger > 1000000) { message.channel.send(':x: Error! Number is too high!'); } else { - message.channel.send(romanNumeralConverter.getRomanFromInteger(numberified)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered nothing?')); + message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered nothing?')); } } -} - -module.exports = RomanCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/canyounot.js b/commands/random/canyounot.js index 84be81b0..b39d3d6f 100644 --- a/commands/random/canyounot.js +++ b/commands/random/canyounot.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class CanYouNot extends commando.Command { +module.exports = class CanYouNot extends commando.Command { constructor(Client){ super(Client, { - name: 'canyounot', + name: 'canyounot', group: 'random', memberName: 'canyounot', description: 'Can YOU not? (;canyounot)', @@ -11,14 +11,11 @@ class CanYouNot 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); message.channel.send('Can YOU not?'); } -} - -module.exports = CanYouNot; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/giveflower.js b/commands/random/giveflower.js index 9dd6e081..923943d9 100644 --- a/commands/random/giveflower.js +++ b/commands/random/giveflower.js @@ -1,9 +1,13 @@ const commando = require('discord.js-commando'); -class GiveFlowerCommand extends commando.Command { +module.exports = class GiveFlowerCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'giveflower', + name: 'giveflower', + aliases: [ + 'present', + 'gift' + ], group: 'random', memberName: 'giveflower', description: 'Gives Xiao Pai a flower. (;giveflower)', @@ -11,14 +15,11 @@ class GiveFlowerCommand 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); message.channel.send('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪'); } -} - -module.exports = GiveFlowerCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/lenny.js b/commands/random/lenny.js index c62033b6..92932e5b 100644 --- a/commands/random/lenny.js +++ b/commands/random/lenny.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class LennyCommand extends commando.Command { +module.exports = class LennyCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'lenny', + name: 'lenny', group: 'random', memberName: 'lenny', description: 'Responds with the lenny face. (;lenny)', @@ -11,14 +11,11 @@ class LennyCommand 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); message.channel.send('( ͡° ͜ʖ ͡°)'); } -} - -module.exports = LennyCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/lottery.js b/commands/random/lottery.js index 0f216a65..ed19382a 100644 --- a/commands/random/lottery.js +++ b/commands/random/lottery.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class LotteryCommand extends commando.Command { +module.exports = class LotteryCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'lottery', + name: 'lottery', group: 'random', memberName: 'lottery', description: '1 in 100 Chance of Winning. Winners get... The feeling of winning? (;lottery)', @@ -11,19 +11,16 @@ class LotteryCommand 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 lotterynumber = ['Winner'][Math.floor(Math.random() * 100)]; - if(lotterynumber === "Winner") { + let lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)]; + if(lotteryNumber === "Winner") { message.channel.send("Wow " + message.author.username + "! You actually won! Great job!"); } else { - message.channel.send("Nope, sorry, " + message.author.username + ", you lost. RIP you."); + message.channel.send("Nope, sorry, " + message.author.username + ", you lost."); } } -} - -module.exports = LotteryCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/mathgame.js b/commands/random/mathgame.js index 21780902..f847d044 100644 --- a/commands/random/mathgame.js +++ b/commands/random/mathgame.js @@ -2,10 +2,10 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const math = require('mathjs'); -class MathGameCommand extends commando.Command { +module.exports = class MathGameCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'mathgame', + name: 'mathgame', group: 'random', memberName: 'mathgame', description: 'See how fast you can answer a math problem in a given time limit. (;mathgame easy)', @@ -13,11 +13,9 @@ class MathGameCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); let [level] = message.content.toLowerCase().split(" ").slice(1); @@ -61,6 +59,4 @@ class MathGameCommand extends commando.Command { }); } } -} - -module.exports = MathGameCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/nitro.js b/commands/random/nitro.js index 355e8ded..1e060d80 100644 --- a/commands/random/nitro.js +++ b/commands/random/nitro.js @@ -1,10 +1,10 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class NitroCommand extends commando.Command { +module.exports = class NitroCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'nitro', + name: 'nitro', group: 'random', memberName: 'nitro', description: 'Sends a "This Message Can Only be viewed by Nitro Members" message. (;nitro)', @@ -12,11 +12,9 @@ class NitroCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); const embed = new Discord.RichEmbed() @@ -27,6 +25,4 @@ class NitroCommand extends commando.Command { .setDescription("This Message can only be viewed by members with Discord Nitro.\n\n\n[More Information](https://discordapp.com/nitro)"); message.channel.sendEmbed(embed).catch(console.error); } -} - -module.exports = NitroCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/slowclap.js b/commands/random/slowclap.js index 0a95abf7..d10442bd 100644 --- a/commands/random/slowclap.js +++ b/commands/random/slowclap.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class SlowClapCommand extends commando.Command { +module.exports = class SlowClapCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'slowclap', + name: 'slowclap', group: 'random', memberName: 'slowclap', description: '*Slow Clap*. (;slowclap)', @@ -11,14 +11,11 @@ class SlowClapCommand 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); message.channel.send('*slow clap*'); } -} - -module.exports = SlowClapCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/soundboard.js b/commands/random/soundboard.js index f06b91cf..4818c063 100644 --- a/commands/random/soundboard.js +++ b/commands/random/soundboard.js @@ -1,10 +1,14 @@ const commando = require('discord.js-commando'); const sounds = require('./sounds.json'); -class SoundBoardCommand extends commando.Command { +module.exports = class SoundBoardCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'soundboard', + name: 'soundboard', + aliases: [ + 'sound', + 'play' + ], group: 'random', memberName: 'soundboard', description: 'Plays a sound in your voice channel. (;soundboard cat)', @@ -12,10 +16,9 @@ class SoundBoardCommand 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); if(message.channel.type !== 'dm') { @@ -40,9 +43,9 @@ class SoundBoardCommand extends commando.Command { message.channel.send(':x: Error! I am already playing a sound!'); } } else { - voiceChannel.join().then(connnection => { + voiceChannel.join().then(connection => { let stream = sounds.paths[soundToPlay]; - let dispatcher = connnection.playStream(stream); + let dispatcher = connection.playStream(stream); message.react('🔊'); dispatcher.on('end', () => { voiceChannel.leave(); @@ -51,13 +54,11 @@ class SoundBoardCommand extends commando.Command { }); } } else { - message.channel.send(':x: Error! Sound not found! Please use ;soundboard list to see a list of sounds you can play.'); + message.channel.send(':x: Error! Sound not found! Use `;soundboard list` to see a list of sounds you can play.'); } } } else { message.channel.send(':x: This is a DM!'); } } -} - -module.exports = SoundBoardCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/spam.js b/commands/random/spam.js index 61e7462c..0148cdb8 100644 --- a/commands/random/spam.js +++ b/commands/random/spam.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class SpamCommand extends commando.Command { +module.exports = class SpamCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'spam', + name: 'spam', group: 'random', memberName: 'spam', description: 'Puts a picture of Spam. (;spam)', @@ -11,16 +11,11 @@ class SpamCommand 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); - message.channel.send("Spam!"); message.channel.sendFile("./images/Spam.jpg"); } -} - -module.exports = SpamCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/today.js b/commands/random/today.js index 01e25df2..50430753 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -1,11 +1,14 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); -class TodayCommand extends commando.Command { +module.exports = class TodayCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'today', + name: 'today', + aliases: [ + 'history' + ], group: 'random', memberName: 'today', description: 'Tells you what happened today. (;today)', @@ -13,31 +16,24 @@ class TodayCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - const options = { - method: 'GET', - uri: 'http://history.muffinlabs.com/date', - json: true - } - request(options).then(function (response) { - let randomNumber = Math.floor(Math.random() * response.data.Events.length); + request + .get('http://history.muffinlabs.com/date') + .then(function (response) { + let randomNumber = Math.floor(Math.random() * response.body.data.Events.length); const embed = new Discord.RichEmbed() .setColor(0x9797FF) - .setURL(response.url) - .setTitle('On this day (' + response.date + ')...') + .setURL(response.body.url) + .setTitle('On this day (' + response.body.date + ')...') .setTimestamp() - .setDescription(response.data.Events[randomNumber].text + ' (' + response.data.Events[randomNumber].year + ')'); + .setDescription(response.body.data.Events[randomNumber].text + ' (' + response.body.data.Events[randomNumber].year + ')'); message.channel.sendEmbed(embed).catch(console.error); }).catch(function (err) { message.channel.send(":x: Error! Something went wrong!"); }); } -} - -module.exports = TodayCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/random/typinggame.js b/commands/random/typinggame.js index b5826d76..b8153570 100644 --- a/commands/random/typinggame.js +++ b/commands/random/typinggame.js @@ -1,10 +1,10 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class TypingGameCommand extends commando.Command { +module.exports = class TypingGameCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'typinggame', + name: 'typinggame', group: 'random', memberName: 'typinggame', description: 'See how fast you can type a sentence in a given time limit. (;typinggame easy)', @@ -12,11 +12,9 @@ class TypingGameCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); let [level] = message.content.toLowerCase().split(" ").slice(1); @@ -71,6 +69,4 @@ class TypingGameCommand extends commando.Command { }); } } -} - -module.exports = TypingGameCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/8ball.js b/commands/response/8ball.js index d9145a50..ad85ea51 100644 --- a/commands/response/8ball.js +++ b/commands/response/8ball.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class MagicBall extends commando.Command { +module.exports = class MagicBall extends commando.Command { constructor(Client){ super(Client, { - name: '8ball', + name: '8ball', group: 'response', memberName: '8ball', description: 'Predicts your future. (;8ball Am I stupid?)', @@ -11,20 +11,17 @@ class MagicBall 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 question = message.content.split(" ").slice(1).join(" "); - let coin = ['It seems the answer is yes, yes?', 'It seems the answer is no.', 'It is a little doubtful, yes?', 'It seems it is very likely to be true.']; - coin = coin[Math.floor(Math.random() * coin.length)]; + let answers = ['It seems the answer is yes, yes?', 'It seems the answer is no.', 'It is a little doubtful, yes?', 'It seems it is very likely to be true.']; + answers = answers[Math.floor(Math.random() * answers.length)]; if(question === "") { question = "Not Specified." } - message.channel.send("Question: " + question + "\n:8ball: " + coin + " :8ball:"); + message.channel.send("Question: " + question + "\n:8ball: " + answers + " :8ball:"); } -} - -module.exports = MagicBall; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/cat.js b/commands/response/cat.js index b54bb9dd..3e245466 100644 --- a/commands/response/cat.js +++ b/commands/response/cat.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class RandomCat extends commando.Command { +module.exports = class RandomCat extends commando.Command { constructor(Client){ super(Client, { - name: 'cat', + name: 'cat', group: 'response', memberName: 'cat', description: 'Sends a random cat picture. (;cat)', @@ -11,17 +11,13 @@ class RandomCat 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); - let cat = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpeg", "12.jpg", "13.jpeg", "14.png", "15.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg"] + let cat = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpeg", "12.jpg", "13.jpeg", "14.png", "15.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg"]; cat = cat[Math.floor(Math.random() * cat.length)]; message.channel.sendFile("./images/Cat" + cat); } -} - -module.exports = RandomCat; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/choose.js b/commands/response/choose.js index f6f00fcc..83bc7e6e 100644 --- a/commands/response/choose.js +++ b/commands/response/choose.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class ChooseCommand extends commando.Command { +module.exports = class ChooseCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'choose', + name: 'choose', + aliases: [ + 'pick' + ], group: 'response', memberName: 'choose', description: 'Chooses between two things. (;choose Cow | Sheep)', @@ -11,10 +14,9 @@ class ChooseCommand 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); if(message.content.includes("|")) { @@ -27,6 +29,4 @@ class ChooseCommand extends commando.Command { message.channel.send(":x: Split your two choices with a ' | '!"); } } -} - -module.exports = ChooseCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/coin.js b/commands/response/coin.js index b36066b1..c6ce44c5 100644 --- a/commands/response/coin.js +++ b/commands/response/coin.js @@ -1,9 +1,13 @@ const commando = require('discord.js-commando'); -class CoinFlipCommand extends commando.Command { +module.exports = class CoinFlipCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'coin', + name: 'coin', + aliases: [ + 'coinflip', + 'flip' + ], group: 'response', memberName: 'coin', description: 'Flips a coin. (;coin)', @@ -11,16 +15,13 @@ class CoinFlipCommand 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 = ['Heads', 'Tails']; coin = coin[Math.floor(Math.random() * coin.length)]; message.channel.send("It landed on " + coin); } -} - -module.exports = CoinFlipCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/compliment.js b/commands/response/compliment.js index e3246fd4..211d1817 100644 --- a/commands/response/compliment.js +++ b/commands/response/compliment.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class ComplimentCommand extends commando.Command { +module.exports = class ComplimentCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'compliment', + name: 'compliment', group: 'response', memberName: 'compliment', description: 'Compliments the user of your choice. (;compliment @User)', @@ -11,21 +11,18 @@ class ComplimentCommand 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 username = message.content.split(" ").slice(1).join(" "); - let coin = ["Your smile is contagious.", "You look great today.", "You're a smart cookie.", "I bet you make babies smile.", "You have impeccable manners.", "I like your style.", "You have the best laugh.", "I appreciate you.", "You are the most perfect you there is.", "You are enough.", "You're strong.", "Your perspective is refreshing.", "You're an awesome friend.", "You light up the room.", "You shine brighter than a shooting star.", "You deserve a hug right now.", "You should be proud of yourself.", "You're more helpful than you realize.", "You have a great sense of humor.", "You've got all the right moves!", "Is that your picture next to 'charming' in the dictionary?", "Your kindness is a balm to all who encounter it.", "You're all that and a super-size bag of chips.", "On a scale from 1 to 10, you're an 11.", "You are brave.", "You're even more beautiful on the inside than you are on the outside.", "You have the courage of your convictions.", "Your eyes are breathtaking.", "If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.", "You are making a difference.", "You're like sunshine on a rainy day.", "You bring out the best in other people.", "Your ability to recall random factoids at just the right time is impressive.", "You're a great listener.", "How is it that you always look great, even in sweatpants?", "Everything would be better if more people were like you!", "I bet you sweat glitter.", "You were cool way before hipsters were cool.", "That color is perfect on you.", "Hanging out with you is always a blast.", "You always know -- and say -- exactly what I need to hear when I need to hear it.", "You smell really good.", "You may dance like no one's watching, but everyone's watching because you're an amazing dancer!", "Being around you makes everything better!", "When you say, 'I meant to do that,' I totally believe you.", "When you're not afraid to be yourself is when you're most incredible.", "Colors seem brighter when you're around.", "You're more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)", "That thing you don't like about yourself is what makes you so interesting.", "You're wonderful.", "You have cute elbows. For reals!", "Jokes are funnier when you tell them.", "You're better than a triple-scoop ice cream cone. With sprinkles.", "Your bellybutton is kind of adorable.", "Your hair looks stunning.", "You're one of a kind!", "You're inspiring.", "If you were a box of crayons, you'd be the giant name-brand one with the built-in sharpener.", "You should be thanked more often. So thank you!!", "Our community is better because you're in it.", "Someone is getting through something hard right now because you've got their back.", "You have the best ideas.", "You always know how to find that silver lining.", "Everyone gets knocked down sometimes, but you always get back up and keep going.", "You're a candle in the darkness.", "You're a great example to others.", "Being around you is like being on a happy little vacation.", "You always know just what to say.", "You're always learning new things and trying to better yourself, which is awesome.", "If someone based an Internet meme on you, it would have impeccable grammar.", "You could survive a Zombie apocalypse.", "You're more fun than bubble wrap.", "When you make a mistake, you fix it.", "Who raised you? They deserve a medal for a job well done.", "You're great at figuring stuff out.", "Your voice is magnificent.", "The people you love are lucky to have you in their lives.", "You're like a breath of fresh air.", "You're gorgeous -- and that's the least interesting thing about you, too.", "You're so thoughtful.", "Your creative potential seems limitless.", "Your name suits you to a T.", "You're irresistible when you blush.", "Actions speak louder than words, and yours tell an incredible story.", "Somehow you make time stop and fly at the same time.", "When you make up your mind about something, nothing stands in your way.", "You seem to really know who you are.", "Any team would be lucky to have you on it.", "In high school I bet you were voted 'most likely to keep being awesome.'", "I bet you do the crossword puzzle in ink.", "Babies and small animals probably love you.", "If you were a scented candle they'd call it Perfectly Imperfect (and it would smell like summer).", "There's ordinary, and then there's you.", "You're someone's reason to smile.", "You're even better than a unicorn, because you're real.", "How do you keep being so funny and making everyone laugh?", "You have a good head on your shoulders.", "Has anyone ever told you that you have great posture?", "The way you treasure your loved ones is incredible.", "You're really something special.", "You're a gift to those around you.", "You don't deserve it."]; - coin = coin[Math.floor(Math.random() * coin.length)]; - if(username === '') { - message.reply(coin); + let thingToCompliment = message.content.split(" ").slice(1).join(" "); + let compliments = ["Your smile is contagious.", "You look great today.", "You're a smart cookie.", "I bet you make babies smile.", "You have impeccable manners.", "I like your style.", "You have the best laugh.", "I appreciate you.", "You are the most perfect you there is.", "You are enough.", "You're strong.", "Your perspective is refreshing.", "You're an awesome friend.", "You light up the room.", "You shine brighter than a shooting star.", "You deserve a hug right now.", "You should be proud of yourself.", "You're more helpful than you realize.", "You have a great sense of humor.", "You've got all the right moves!", "Is that your picture next to 'charming' in the dictionary?", "Your kindness is a balm to all who encounter it.", "You're all that and a super-size bag of chips.", "On a scale from 1 to 10, you're an 11.", "You are brave.", "You're even more beautiful on the inside than you are on the outside.", "You have the courage of your convictions.", "Your eyes are breathtaking.", "If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.", "You are making a difference.", "You're like sunshine on a rainy day.", "You bring out the best in other people.", "Your ability to recall random factoids at just the right time is impressive.", "You're a great listener.", "How is it that you always look great, even in sweatpants?", "Everything would be better if more people were like you!", "I bet you sweat glitter.", "You were cool way before hipsters were cool.", "That color is perfect on you.", "Hanging out with you is always a blast.", "You always know -- and say -- exactly what I need to hear when I need to hear it.", "You smell really good.", "You may dance like no one's watching, but everyone's watching because you're an amazing dancer!", "Being around you makes everything better!", "When you say, 'I meant to do that,' I totally believe you.", "When you're not afraid to be yourself is when you're most incredible.", "Colors seem brighter when you're around.", "You're more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)", "That thing you don't like about yourself is what makes you so interesting.", "You're wonderful.", "You have cute elbows. For reals!", "Jokes are funnier when you tell them.", "You're better than a triple-scoop ice cream cone. With sprinkles.", "Your bellybutton is kind of adorable.", "Your hair looks stunning.", "You're one of a kind!", "You're inspiring.", "If you were a box of crayons, you'd be the giant name-brand one with the built-in sharpener.", "You should be thanked more often. So thank you!!", "Our community is better because you're in it.", "Someone is getting through something hard right now because you've got their back.", "You have the best ideas.", "You always know how to find that silver lining.", "Everyone gets knocked down sometimes, but you always get back up and keep going.", "You're a candle in the darkness.", "You're a great example to others.", "Being around you is like being on a happy little vacation.", "You always know just what to say.", "You're always learning new things and trying to better yourself, which is awesome.", "If someone based an Internet meme on you, it would have impeccable grammar.", "You could survive a Zombie apocalypse.", "You're more fun than bubble wrap.", "When you make a mistake, you fix it.", "Who raised you? They deserve a medal for a job well done.", "You're great at figuring stuff out.", "Your voice is magnificent.", "The people you love are lucky to have you in their lives.", "You're like a breath of fresh air.", "You're gorgeous -- and that's the least interesting thing about you, too.", "You're so thoughtful.", "Your creative potential seems limitless.", "Your name suits you to a T.", "You're irresistible when you blush.", "Actions speak louder than words, and yours tell an incredible story.", "Somehow you make time stop and fly at the same time.", "When you make up your mind about something, nothing stands in your way.", "You seem to really know who you are.", "Any team would be lucky to have you on it.", "In high school I bet you were voted 'most likely to keep being awesome.'", "I bet you do the crossword puzzle in ink.", "Babies and small animals probably love you.", "If you were a scented candle they'd call it Perfectly Imperfect (and it would smell like summer).", "There's ordinary, and then there's you.", "You're someone's reason to smile.", "You're even better than a unicorn, because you're real.", "How do you keep being so funny and making everyone laugh?", "You have a good head on your shoulders.", "Has anyone ever told you that you have great posture?", "The way you treasure your loved ones is incredible.", "You're really something special.", "You're a gift to those around you.", "You don't deserve it."]; + compliments = compliments[Math.floor(Math.random() * compliments.length)]; + if(thingToCompliment === '') { + message.reply(compliments); } else { - message.channel.send(username + ", " + coin); + message.channel.send(thingToCompliment + ", " + compliments); } } -} - -module.exports = ComplimentCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/factcore.js b/commands/response/factcore.js index 762b3a5a..9ff5593d 100644 --- a/commands/response/factcore.js +++ b/commands/response/factcore.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class FactCore extends commando.Command { +module.exports = class FactCore extends commando.Command { constructor(Client){ super(Client, { - name: 'factcore', + name: 'factcore', group: 'response', memberName: 'factcore', description: 'Says a random Fact Core quote. (;factcore)', @@ -11,16 +11,13 @@ class FactCore 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 = ["The billionth digit of Pi is 9.", "Humans can survive underwater. But not for very long.", "A nanosecond lasts one billionth of a second.", "Honey does not spoil.", "The atomic weight of Germanium is seven two point four six.", "An ostrich's eye is bigger than its brain.", "Rats cannot throw up.", "Iguanas can stay underwater for twenty-eight point seven minutes.", "The moon orbits the Earth every 27.32 days.", "A gallon of water weighs 8.34 pounds.", "According to Norse legend, thunder god Thor's chariot was pulled across the sky by two goats.", "Tungsten has the highest melting point of any metal, at 3,410 degrees Celsius.", "Gently cleaning the tongue twice a day is the most effective way to fight bad breath.", "The Tariff Act of 1789, established to protect domestic manufacture, was the second salute ever enacted by the United States government.", "The value of Pi is the ratio of any circle's circumference to its diameter in Euclidean space.", "The Mexican-American War ended in 1848 with the signing of the Treaty of Guadalupe Hidalgo.", "In 1879, Sandford Fleming first proposed the adoption of worldwide standardized time zones at the Royal Canadian Institute.", "Marie Curie invented the theory of radioactivity, the treatment of radioactivity, and the dying of radioactivity.", "At the end of The Seagull by Anton Chekhov, Konstantin kills himself.", "Hot water freezes quicker than cold water.", "The situation you are in is very dangerous.", "Polymerase I polypeptide A is a human gene.", "The sun is 333,330 times larger than Earth.", "Dental floss has superb tensile strength.", "Raseph, the Semitic god of war and plague, had a gazelle growing out of his forehead.", "Human tapeworms can grow up to twenty-two point nine meters.", "If you have trouble with simple counting, use the following mnemonic device: one comes before two comes before 60 comes after 12 comes before six trillion comes after 504. This should make your earlier counting difficulties seem like no big deal.", "The first person to prove that cow's milk is drinkable was very, very thirsty.", "Roman toothpaste was made with human urine. Urine as an ingredient in toothpaste continued to be used up until the 18th century.", "Volcano-ologists are experts in the study of volcanoes.", "In Victorian England, a commoner was not allowed to look directly at the Queen, due to a belief at the time that the poor had the ability to steal thoughts. Science now believes that less than 4 percent of poor people are able to do this.", "Cellular phones will not give you cancer. Only hepatitis.", "In Greek myth, Prometheus stole fire from the Gods and gave it to humankind. The jewelry he kept for himself.", "The Schrodinger's cat paradox outlines a situation in which a cat in a box must be considered, for all intents and purposes, simultaneously alive and dead. Schrodinger created this paradox as a justification for killing cats.", "In 1862, Abraham Lincoln signed the Emancipation Proclamation, freeing the slaves. Like everything he did, Lincoln freed the slaves while sleepwalking, and later had no memory of the event.", "The plural of surgeon general is surgeons general. The past tense of surgeons general is surgeonsed general.", "Contrary to popular belief, the Eskimo does not have one hundred different words for snow. They do, however, have two hundred and thirty-four words for fudge.", "Halley's Comet can be viewed orbiting Earth every seventy-six years. For the other seventy-five, it retreats to the heart of the sun, where it hibernates undisturbed.", "The first commercial airline flight took to the air in 1914. Everyone involved screamed the entire way.", "Edmund Hillary, the first person to climb Mount Everest, did so accidentally while chasing a bird.", "We will both die because of your negligence.", "This is a bad plan. You will fail.", "He will most likely kill you, violently.", "He will most likely kill you.", "You will be dead soon.", "You are going to die in this room.", "The Fact Sphere is a good person, whose insights are relevant.", "The Fact Sphere is a good sphere, with many friends.", "Dreams are the subconscious mind's way of reminding people to go to school naked and have their teeth fall out.", "The square root of rope is string.", "89 percent of magic tricks are not actually magic. Technically, they are sorcery.", "At some point in their lives 1 in 6 children will be abducted by the Dutch.", "According to most advanced algorithms, the world's best name is Craig.", "To make a photocopier, simply photocopy a mirror.", "Whales are twice as intelligent, and three times as delicious, as humans.", "Pants were invented by sailors in the sixteenth century to avoid Poseiden's wrath. It was believed that the sight of naked sailors angered the sea god.", "In Greek myth, the craftsman Daedalus invented human flight so a group of Minotaurs would stop teasing him about it.", "The average life expectancy of a rhinoceros in captivity is 15 years.", "China produces the world's second largest crop of soybeans.", "In 1948, at the request of a dying boy, baseball legend Babe Ruth ate seventy-five hot dogs, then died of hot dog poisoning.", "William Shakespeare did not exist. His plays were masterminded in 1589 by Francis Bacon, who used a Ouija board to enslave play-writing ghosts.", "It is incorrectly noted that Thomas Edison invented push-ups in 1878. Nikolai Tesla had in fact patented the activity three years earlier, under the name Tesla-cize.", "The automobile brake was not invented until 1895. Before this, someone had to remain in the car at all times, driving in circles until passengers returned from their errands.", "The most poisonous fish in the world is the orange ruffy. Everything but its eyes are made of deadly poison. The ruffy's eyes are composed of a less harmful, deadly poison.", "The occupation of court jester was invented accidentally, when a vassal's epilepsy was mistaken for capering.", "Before the Wright Brothers invented the airplane, anyone wanting to fly anywhere was required to eat 200 pounds of helium.", "Before the invention of scrambled eggs in 1912, the typical breakfast was either whole eggs still in the shell or scrambled rocks.", "During the Great Depression, the Tennessee Valley Authority outlawed pet rabbits, forcing many to hot glue-gun long ears onto their pet mice.", "The situation is hopeless.", "Diamonds are made when coal is put under intense pressure. Diamonds put under intense pressure become foam pellets, commonly used today as packing material.", "Corruption is at 25 percent.", "Corruption is at 50 percent.", "Fact: Space does not exist.", "The Fact Sphere is not defective. Its facts are wholly accurate and very interesting.", "The Fact Sphere is always right.", "You will never go into space.", "The Space Sphere will never go to space.", "While the submarine is vastly superior to the boat in every way, over 97 percent of people still use boats for aquatic transportation.", "The likelihood of you dying within the next five minutes is eighty-seven point six one percent.", "The likelihood of you dying violently within the next five minutes is eighty-seven point six one percent.", "You are about to get me killed.", "The Fact Sphere is the most intelligent sphere.", "The Fact Sphere is the most handsome sphere.", "The Fact Sphere is incredibly handsome.", "Sphere that insist of going into space are inferior to spheres who don't.", "Whoever wins this battle is clearly superior, and will earn the allegiance of the Fact Sphere.", "You could stand to lose a few pounds.", "Avocados have the highest fiber and calories of any fruit.", "Avocados have the highest fiber and calories of any fruit. They are found in Australians.", "Every square inch of the human body has 32 million bacteria on it.", "The average adult body contains half a pound of salt.", "The Adventure Sphere is a blowhard and a coward.", "Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve.", "Pens. Pens. Pens. Pens. Pens. Pens. Pens.", "Apples. Oranges. Pears. Plums. Kumquats. Tangerines. Lemons. Limes. Avocado. Tomoato. Banana. Papaya. Guava.", "Error. Error. Error. File not found.", "Error. Error. Error. Fact not found.", "Fact not found.", "Warning, sphere corruption at twenty-- rats cannot throw up."]; - coin = coin[Math.floor(Math.random() * coin.length)]; - message.channel.send(coin); + let facts = ["The billionth digit of Pi is 9.", "Humans can survive underwater. But not for very long.", "A nanosecond lasts one billionth of a second.", "Honey does not spoil.", "The atomic weight of Germanium is seven two point four six.", "An ostrich's eye is bigger than its brain.", "Rats cannot throw up.", "Iguanas can stay underwater for twenty-eight point seven minutes.", "The moon orbits the Earth every 27.32 days.", "A gallon of water weighs 8.34 pounds.", "According to Norse legend, thunder god Thor's chariot was pulled across the sky by two goats.", "Tungsten has the highest melting point of any metal, at 3,410 degrees Celsius.", "Gently cleaning the tongue twice a day is the most effective way to fight bad breath.", "The Tariff Act of 1789, established to protect domestic manufacture, was the second salute ever enacted by the United States government.", "The value of Pi is the ratio of any circle's circumference to its diameter in Euclidean space.", "The Mexican-American War ended in 1848 with the signing of the Treaty of Guadalupe Hidalgo.", "In 1879, Sandford Fleming first proposed the adoption of worldwide standardized time zones at the Royal Canadian Institute.", "Marie Curie invented the theory of radioactivity, the treatment of radioactivity, and the dying of radioactivity.", "At the end of The Seagull by Anton Chekhov, Konstantin kills himself.", "Hot water freezes quicker than cold water.", "The situation you are in is very dangerous.", "Polymerase I polypeptide A is a human gene.", "The sun is 333,330 times larger than Earth.", "Dental floss has superb tensile strength.", "Raseph, the Semitic god of war and plague, had a gazelle growing out of his forehead.", "Human tapeworms can grow up to twenty-two point nine meters.", "If you have trouble with simple counting, use the following mnemonic device: one comes before two comes before 60 comes after 12 comes before six trillion comes after 504. This should make your earlier counting difficulties seem like no big deal.", "The first person to prove that cow's milk is drinkable was very, very thirsty.", "Roman toothpaste was made with human urine. Urine as an ingredient in toothpaste continued to be used up until the 18th century.", "Volcano-ologists are experts in the study of volcanoes.", "In Victorian England, a commoner was not allowed to look directly at the Queen, due to a belief at the time that the poor had the ability to steal thoughts. Science now believes that less than 4 percent of poor people are able to do this.", "Cellular phones will not give you cancer. Only hepatitis.", "In Greek myth, Prometheus stole fire from the Gods and gave it to humankind. The jewelry he kept for himself.", "The Schrodinger's cat paradox outlines a situation in which a cat in a box must be considered, for all intents and purposes, simultaneously alive and dead. Schrodinger created this paradox as a justification for killing cats.", "In 1862, Abraham Lincoln signed the Emancipation Proclamation, freeing the slaves. Like everything he did, Lincoln freed the slaves while sleepwalking, and later had no memory of the event.", "The plural of surgeon general is surgeons general. The past tense of surgeons general is surgeonsed general.", "Contrary to popular belief, the Eskimo does not have one hundred different words for snow. They do, however, have two hundred and thirty-four words for fudge.", "Halley's Comet can be viewed orbiting Earth every seventy-six years. For the other seventy-five, it retreats to the heart of the sun, where it hibernates undisturbed.", "The first commercial airline flight took to the air in 1914. Everyone involved screamed the entire way.", "Edmund Hillary, the first person to climb Mount Everest, did so accidentally while chasing a bird.", "We will both die because of your negligence.", "This is a bad plan. You will fail.", "He will most likely kill you, violently.", "He will most likely kill you.", "You will be dead soon.", "You are going to die in this room.", "The Fact Sphere is a good person, whose insights are relevant.", "The Fact Sphere is a good sphere, with many friends.", "Dreams are the subconscious mind's way of reminding people to go to school naked and have their teeth fall out.", "The square root of rope is string.", "89 percent of magic tricks are not actually magic. Technically, they are sorcery.", "At some point in their lives 1 in 6 children will be abducted by the Dutch.", "According to most advanced algorithms, the world's best name is Craig.", "To make a photocopier, simply photocopy a mirror.", "Whales are twice as intelligent, and three times as delicious, as humans.", "Pants were invented by sailors in the sixteenth century to avoid Poseiden's wrath. It was believed that the sight of naked sailors angered the sea god.", "In Greek myth, the craftsman Daedalus invented human flight so a group of Minotaurs would stop teasing him about it.", "The average life expectancy of a rhinoceros in captivity is 15 years.", "China produces the world's second largest crop of soybeans.", "In 1948, at the request of a dying boy, baseball legend Babe Ruth ate seventy-five hot dogs, then died of hot dog poisoning.", "William Shakespeare did not exist. His plays were masterminded in 1589 by Francis Bacon, who used a Ouija board to enslave play-writing ghosts.", "It is incorrectly noted that Thomas Edison invented push-ups in 1878. Nikolai Tesla had in fact patented the activity three years earlier, under the name Tesla-cize.", "The automobile brake was not invented until 1895. Before this, someone had to remain in the car at all times, driving in circles until passengers returned from their errands.", "The most poisonous fish in the world is the orange ruffy. Everything but its eyes are made of deadly poison. The ruffy's eyes are composed of a less harmful, deadly poison.", "The occupation of court jester was invented accidentally, when a vassal's epilepsy was mistaken for capering.", "Before the Wright Brothers invented the airplane, anyone wanting to fly anywhere was required to eat 200 pounds of helium.", "Before the invention of scrambled eggs in 1912, the typical breakfast was either whole eggs still in the shell or scrambled rocks.", "During the Great Depression, the Tennessee Valley Authority outlawed pet rabbits, forcing many to hot glue-gun long ears onto their pet mice.", "The situation is hopeless.", "Diamonds are made when coal is put under intense pressure. Diamonds put under intense pressure become foam pellets, commonly used today as packing material.", "Corruption is at 25 percent.", "Corruption is at 50 percent.", "Fact: Space does not exist.", "The Fact Sphere is not defective. Its facts are wholly accurate and very interesting.", "The Fact Sphere is always right.", "You will never go into space.", "The Space Sphere will never go to space.", "While the submarine is vastly superior to the boat in every way, over 97 percent of people still use boats for aquatic transportation.", "The likelihood of you dying within the next five minutes is eighty-seven point six one percent.", "The likelihood of you dying violently within the next five minutes is eighty-seven point six one percent.", "You are about to get me killed.", "The Fact Sphere is the most intelligent sphere.", "The Fact Sphere is the most handsome sphere.", "The Fact Sphere is incredibly handsome.", "Sphere that insist of going into space are inferior to spheres who don't.", "Whoever wins this battle is clearly superior, and will earn the allegiance of the Fact Sphere.", "You could stand to lose a few pounds.", "Avocados have the highest fiber and calories of any fruit.", "Avocados have the highest fiber and calories of any fruit. They are found in Australians.", "Every square inch of the human body has 32 million bacteria on it.", "The average adult body contains half a pound of salt.", "The Adventure Sphere is a blowhard and a coward.", "Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve. Twelve.", "Pens. Pens. Pens. Pens. Pens. Pens. Pens.", "Apples. Oranges. Pears. Plums. Kumquats. Tangerines. Lemons. Limes. Avocado. Tomoato. Banana. Papaya. Guava.", "Error. Error. Error. File not found.", "Error. Error. Error. Fact not found.", "Fact not found.", "Warning, sphere corruption at twenty-- rats cannot throw up."]; + facts = facts[Math.floor(Math.random() * facts.length)]; + message.channel.send(facts); } -} - -module.exports = FactCore; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/fishy.js b/commands/response/fishy.js index cd7256aa..cd5f9d77 100644 --- a/commands/response/fishy.js +++ b/commands/response/fishy.js @@ -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; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/fortune.js b/commands/response/fortune.js index f4cb9460..56a0b503 100644 --- a/commands/response/fortune.js +++ b/commands/response/fortune.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class FortuneCookieCommand extends commando.Command { +module.exports = class FortuneCookieCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'fortune', + name: 'fortune', + aliases: [ + 'fortunecookie' + ], group: 'response', memberName: 'fortune', description: 'Fortune Cookie. (;fortune)', @@ -11,16 +14,13 @@ class FortuneCookieCommand 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 fortunes = ["Do not seek so much to find the answer as much as to understand the question better.", "You will soon be honored by someone you respect.", "Happiness comes from a good life.", "You are contemplating some action which will bring credit upon you.", "Be prepared for extra energy.", "You are admired for your adventurous ways.", "The love of your life is sitting across from you.", "Beauty is simply beauty. Originality is magical.", "Never quit!", "Today is an ideal time to water your personal garden.", "Questions provide the key to unlocking our unlimited potential.", "Expect great things and great things will come.", "The Greatest War Sometimes Isn't On The Battlefield But Against Oneself.", "Become who you are.", "In case of fire, keep calm, pay bill and run.", "Anyone who dares to be, can never be weak.", "You broke my cookie!", "Dream lofty dreams, and as you dream, so shall you become.", "You've got what it takes, but it will take everything you've got!", "Trust your intuition.", "The wise are aware of their treasure, while fools follow their vanity.", "You will always have good luck in your personal affairs.", "You don't need talent to gain experience.", "All the preparation you've done will finally be paying off!", "Determination is the wake-up call to the human will.", "The most useless energy is trying to change what and who God so carefully created.", "You cannot become rich except by enriching others.", "Your happiness is intertwined with your outlook on life.", "Sing and rejoice, fortune is smiling on you.", "Well-arranged time is the surest sign of a well-arranged mind."]; fortunes = fortunes[Math.floor(Math.random() * fortunes.length)]; message.channel.send(fortunes); } -} - -module.exports = FortuneCookieCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/motivate.js b/commands/response/motivate.js index 34e6c83e..590a4f55 100644 --- a/commands/response/motivate.js +++ b/commands/response/motivate.js @@ -1,9 +1,13 @@ const commando = require('discord.js-commando'); -class MotivateCommand extends commando.Command { +module.exports = class MotivateCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'motivate', + name: 'motivate', + aliases: [ + 'encourage', + 'justdoit' + ], group: 'response', memberName: 'motivate', description: 'Motivates someone. (;motivate @User)', @@ -11,21 +15,16 @@ class MotivateCommand 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 username = message.content.split(" ").slice(1).join(" "); - let coin = ['https://www.youtube.com/watch?v=ZXsQAXx_ao0']; - coin = coin[Math.floor(Math.random() * coin.length)]; - if(username === '') { - message.reply(coin); + let userToMotivate = message.content.split(" ").slice(1).join(" "); + if(userToMotivate === '') { + message.reply('https://www.youtube.com/watch?v=ZXsQAXx_ao0'); } else { - message.channel.send(username + ", " + coin); + message.channel.send(userToMotivate + ", https://www.youtube.com/watch?v=ZXsQAXx_ao0"); } } -} - -module.exports = MotivateCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/name.js b/commands/response/name.js index 90cb7d69..b993dbb9 100644 --- a/commands/response/name.js +++ b/commands/response/name.js @@ -1,38 +1,39 @@ const commando = require('discord.js-commando'); -class RandomNameGen extends commando.Command { +module.exports = class RandomNameGen extends commando.Command { constructor(Client){ super(Client, { - name: 'name', + name: 'name', + aliases: [ + 'namegen', + 'randomname' + ], group: 'response', memberName: 'name', - description: 'Generates a random name (;name Male or ;name Female)', + description: 'Generates a random name (;name Male)', examples: [';name', ';name male', ';name female'] }); } - 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 randomfirstmale = ["Bob", "Daniel", "Logan", "Chris", "Nathan", "George", "Mart", "Charlie", "Felix", "Ralph", "William", "Max", "Jerry", "Marty", "Joshua", "Cody", "Richard", "Alex", "Alexander", "Jordan", "Zachary", "Bill", "Alfred", "Bruce", "Caiden", "Calvin", "Eric", "Robert", "Mark", "Miles", "Nash", "Ronald", "Ivan", "Edgar", "Royal", "Augustine", "Dominic", "Noel", "Rocky", "Grover", "Paul", "Jeremy", "Stevie", "Brock", "Jc", "Tony", "Enoch", "Zachery", "Harvey", "Gilbert", "Chang", "Emery", "Carroll", "Odell", "Jean", "Archie", "Russ", "Barry", "Lowell", "Jacob", "Riku", "Frederic", "Levi", "Faustino", "Leland", "Domenic", "Irwin", "Moises", "Louie", "Larry", "Victor"]; - randomfirstmale = randomfirstmale[Math.floor(Math.random() * randomfirstmale.length)]; - let randomfirstfemale = ["Elizabeth", "Chelsey", "Rachel", "Logan", "Alex", "Jordan", "Mary", "Shirley", "Sandy", "Linda", "Audrey", "Autumn", "Gracie", "Grace", "Erin", "Catherine", "Stephanie", "Lucy", "Patty", "Julie", "Christina", "Fiona", "Riley", "Ashley", "Bree", "Lucila", "Wendi", "Evangelina", "Ricki", "Merna", "Tegan", "Venus", "Claris", "Tana", "Sakura", "Edythe", "Adena", "Princess", "Elnora", "Star", "Edyth", "Beverly", "Kelsie", "Letha", "Latisha", "Lolita", "Bernandine", "Jessenia", "Hannah", "Leonore", "Alene", "Fannie", "Bernardine", "Leena", "Tera", "Yvette", "Melisa", "Alissa", "Xiao", "Richelle", "Bridgett", "Sumiko", "Paulette", "Charlott", "Honey", "Veola", "Sherita", "Amanda", "Vannessa", "April", "Ruth"]; - randomfirstfemale = randomfirstfemale[Math.floor(Math.random() * randomfirstfemale.length)]; - let randomlast = ["Walker", "Tworni", "Ross", "Smith", "Odendahl", "Deere", "Brown", "Williams", "Jones", "Miles", "Moss", "Roberto", "McFly", "McDonald", "Lewis", "Armstrong", "Stevenson", "Schwarzenegger", "Robinson", "Parker", "Piper", "Johnson", "Brantley", "Stewart", "Ree", "Talbot", "Seville", "Peace", "Spielberg", "Baggins", "Wilborn", "Vankirk", "Shireman", "Jimerson", "Masters", "Hack", "Satcher", "Younkin", "Aguila", "Duffey", "Burgin", "Highfall", "Wee", "Solari", "Tomaselli", "Basler", "Difranco", "Latch", "Rives", "Dolan", "Abraham", "Holter", "Portugal", "Lininger", "Holst", "Mccroy", "Follmer", "Hotchkiss", "Gassaway", "Wang", "Agron", "Raasch", "Gourd", "Czaja", "Marquart", "Papadopoulos", "Ringer", "Lax", "Sperling", "Galusha", "Alston"]; - randomlast = randomlast[Math.floor(Math.random() * randomlast.length)]; - let randomfirstboth = [randomfirstmale, randomfirstfemale] - randomfirstboth = randomfirstboth[Math.floor(Math.random() * randomfirstboth.length)]; + let randomFirstMale = ["Bob", "Daniel", "Logan", "Chris", "Nathan", "George", "Mart", "Charlie", "Felix", "Ralph", "William", "Max", "Jerry", "Marty", "Joshua", "Cody", "Richard", "Alex", "Alexander", "Jordan", "Zachary", "Bill", "Alfred", "Bruce", "Caiden", "Calvin", "Eric", "Robert", "Mark", "Miles", "Nash", "Ronald", "Ivan", "Edgar", "Royal", "Augustine", "Dominic", "Noel", "Rocky", "Grover", "Paul", "Jeremy", "Stevie", "Brock", "Jc", "Tony", "Enoch", "Zachery", "Harvey", "Gilbert", "Chang", "Emery", "Carroll", "Odell", "Jean", "Archie", "Russ", "Barry", "Lowell", "Jacob", "Riku", "Frederic", "Levi", "Faustino", "Leland", "Domenic", "Irwin", "Moises", "Louie", "Larry", "Victor"]; + randomFirstMale = randomFirstMale[Math.floor(Math.random() * randomFirstMale.length)]; + let randomFirstFemale = ["Elizabeth", "Chelsey", "Rachel", "Logan", "Alex", "Jordan", "Mary", "Shirley", "Sandy", "Linda", "Audrey", "Autumn", "Gracie", "Grace", "Erin", "Catherine", "Stephanie", "Lucy", "Patty", "Julie", "Christina", "Fiona", "Riley", "Ashley", "Bree", "Lucila", "Wendi", "Evangelina", "Ricki", "Merna", "Tegan", "Venus", "Claris", "Tana", "Sakura", "Edythe", "Adena", "Princess", "Elnora", "Star", "Edyth", "Beverly", "Kelsie", "Letha", "Latisha", "Lolita", "Bernandine", "Jessenia", "Hannah", "Leonore", "Alene", "Fannie", "Bernardine", "Leena", "Tera", "Yvette", "Melisa", "Alissa", "Xiao", "Richelle", "Bridgett", "Sumiko", "Paulette", "Charlott", "Honey", "Veola", "Sherita", "Amanda", "Vannessa", "April", "Ruth"]; + randomFirstFemale = randomFirstFemale[Math.floor(Math.random() * randomFirstFemale.length)]; + let randomLast = ["Walker", "Tworni", "Ross", "Smith", "Odendahl", "Deere", "Brown", "Williams", "Jones", "Miles", "Moss", "Roberto", "McFly", "McDonald", "Lewis", "Armstrong", "Stevenson", "Schwarzenegger", "Robinson", "Parker", "Piper", "Johnson", "Brantley", "Stewart", "Ree", "Talbot", "Seville", "Peace", "Spielberg", "Baggins", "Wilborn", "Vankirk", "Shireman", "Jimerson", "Masters", "Hack", "Satcher", "Younkin", "Aguila", "Duffey", "Burgin", "Highfall", "Wee", "Solari", "Tomaselli", "Basler", "Difranco", "Latch", "Rives", "Dolan", "Abraham", "Holter", "Portugal", "Lininger", "Holst", "Mccroy", "Follmer", "Hotchkiss", "Gassaway", "Wang", "Agron", "Raasch", "Gourd", "Czaja", "Marquart", "Papadopoulos", "Ringer", "Lax", "Sperling", "Galusha", "Alston"]; + randomLast = randomLast[Math.floor(Math.random() * randomLast.length)]; + let randomFirstBoth = [randomFirstMale, randomFirstFemale] + randomFirstBoth = randomFirstBoth[Math.floor(Math.random() * randomFirstBoth.length)]; if(message.content.toLowerCase().split(" ").slice(1).includes("male")) { - message.channel.send(randomfirstmale + " " + randomlast); + message.channel.send(randomFirstMale + " " + randomLast); } else if(message.content.toLowerCase().split(" ").slice(1).includes("female")) { - message.channel.send(randomfirstfemale + " " + randomlast); + message.channel.send(randomFirstFemale + " " + randomLast); } else { - message.channel.send(randomfirstboth + " " + randomlast); + message.channel.send(randomFirstBoth + " " + randomLast); } } -} - -module.exports = RandomNameGen; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/offspring.js b/commands/response/offspring.js index 92709804..40d10b16 100644 --- a/commands/response/offspring.js +++ b/commands/response/offspring.js @@ -1,9 +1,14 @@ const commando = require('discord.js-commando'); -class OffspringCommand extends commando.Command { +module.exports = class OffspringCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'offspring', + name: 'offspring', + aliases: [ + 'child', + 'baby', + 'sex' + ], group: 'response', memberName: 'offspring', description: 'Tells you if your new child is a boy or a girl. (;offspring)', @@ -11,16 +16,13 @@ class OffspringCommand 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 gender = ['boy', 'girl']; gender = gender[Math.floor(Math.random() * gender.length)]; message.channel.send("It's a " + gender + "!"); } -} - -module.exports = OffspringCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/potato.js b/commands/response/potato.js index edeb9bf4..1011f9cb 100644 --- a/commands/response/potato.js +++ b/commands/response/potato.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class PotatoCommand extends commando.Command { +module.exports = class PotatoCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'potato', + name: 'potato', group: 'response', memberName: 'potato', description: 'Sends a random Potato picture. (;potato)', @@ -13,15 +13,11 @@ class PotatoCommand extends commando.Command { async run(message, args) { 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); let potato = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.gif", "6.png", "7.jpg", "8.jpg", "9.jpg"]; potato = potato[Math.floor(Math.random() * potato.length)]; message.channel.sendFile("./images/Potato" + potato); } -} - -module.exports = PotatoCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/pun.js b/commands/response/pun.js index ad7db7a6..e2ae1a1b 100644 --- a/commands/response/pun.js +++ b/commands/response/pun.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class RandomPun extends commando.Command { +module.exports = class RandomPun extends commando.Command { constructor(Client){ super(Client, { - name: 'pun', + name: 'pun', group: 'response', memberName: 'pun', description: 'Sends a random pun image. (;pun)', @@ -11,17 +11,13 @@ class RandomPun 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); let pun = ["Pun1.jpg", "Pun2.jpg", "Pun3.jpg", "Pun4.jpg", "Pun5.jpg", "Pun6.jpg", "Pun7.jpg", "Pun8.png", "Pun9.jpg", "Pun10.jpg", "Pun11.jpg", "Pun12.jpg", "Pun13.jpg", "Pun14.jpg", "Pun15.jpg", "Pun16.jpg", "Pun17.jpg", "Pun18.jpg", "Pun19.jpg", "Pun20.jpg", "Pun21.jpg", "Pun22.jpg", "Pun23.jpg", "Pun24.jpg", "Pun25.jpg", "Pun26.jpg", "Pun27.jpg", "Pun28.jpg", "Pun29.jpg", "Pun30.jpeg", "Pun31.jpg", "Pun32.jpg", "Pun33.jpg", "Pun34.png", "Pun35.jpg", "Pun36.jpg", "Pun37.jpg", "Pun38.jpg", "Pun39.jpg", "Pun40.jpg", "Pun41.jpg", "Pun42.jpg", "Pun43.jpg", "Pun44.jpg", "Pun45.gif", "Pun46.jpg", "Pun47.jpg", "Pun48.jpg", "Pun49.jpg", "Pun50.jpg", "Pun51.jpg", "Pun52.jpg", "Pun53.jpg"]; pun = pun[Math.floor(Math.random() * pun.length)]; message.channel.sendFile("./images/" + pun); } -} - -module.exports = RandomPun; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/quantumcoin.js b/commands/response/quantumcoin.js index a7ed6ffe..069334b3 100644 --- a/commands/response/quantumcoin.js +++ b/commands/response/quantumcoin.js @@ -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; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/ratewaifu.js b/commands/response/ratewaifu.js index d9d7cb51..61ec5eb8 100644 --- a/commands/response/ratewaifu.js +++ b/commands/response/ratewaifu.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class RateWaifuCommand extends commando.Command { +module.exports = class RateWaifuCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'ratewaifu', + name: 'ratewaifu', + aliases: [ + 'waifu' + ], group: 'response', memberName: 'ratewaifu', description: 'Rates your Waifu. (;ratewaifu Xiao Pai)', @@ -11,16 +14,13 @@ class RateWaifuCommand 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 username = message.content.split(" ").slice(1).join(" "); + let waifuToRate = message.content.split(" ").slice(1).join(" "); let percentage = Math.floor(Math.random() * 10) + 1; - message.channel.send("I'd give " + username + " a " + percentage + "/10!"); + message.channel.send("I'd give " + waifuToRate + " a " + percentage + "/10!"); } -} - -module.exports = RateWaifuCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/roast.js b/commands/response/roast.js index 5de94780..8620c767 100644 --- a/commands/response/roast.js +++ b/commands/response/roast.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class RoastMeCommand extends commando.Command { +module.exports = class RoastMeCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'roast', + name: 'roast', + aliases: [ + 'burn' + ], group: 'response', memberName: 'roast', description: 'Roasts the user of your choice. (;roast @User)', @@ -11,21 +14,18 @@ class RoastMeCommand 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 username = message.content.split(" ").slice(1).join(" "); - let coin = ["*puts you in the oven*", "You're so stupid.", "Sorry, I can't hear you over how annoying you are.", "I've got better things to do.", "You're as dumb as Cleverbot.", "Your IQ is lower than the Mariana Trench.", "You're so annoying even the flies stay away from your stench.", "Go away, please.", "I'd give you a nasty look but you've already got one.", "It looks like your face caught fire and someone tried to put it out with a hammer.", "Your family tree must be a cactus because everyone on it is a prick.", "Someday you will go far, and I hope you stay there.", "The zoo called. They're wondering how you got out of your cage.", "I was hoping for a battle of wits, but you appear to be unarmed.", "You are proof that evolution can go in reverse.", "Brains aren't everything, in your case, they're nothing.", "Sorry I didn't get that, I don't speak idiot.", "Why is it acceptable for you to be an idiot, but not for me to point it out?", "We all sprang from apes, but you did not spring far enough.", "You're an unknown command.", "If you could go anywhere I chose, I'd choose dead.", "Even monkeys can go to space, so clearly you lack some potential.", "It's brains over brawn, yet you have neither.", "You look like a monkey, and you smell like one too.", "Even among idiots you're lacking.", "You fail even when you're doing absolutely nothing.", "If there was a vote for 'least likely to succeed' you'd win first prize.", "I'm surrounded by idiots... Or, wait, that's just you.", "I wanna go home. Well, really I just want to get away from the awful aroma you've got going there.", "Every time you touch me I have to go home and wash all my clothes nine times just to get a normal smell back.", "If I had a nickel for every brain you don't have, I'd have one dollar.", "I'd help you succeed but you're incapable."]; - coin = coin[Math.floor(Math.random() * coin.length)]; - if(username === '') { - message.reply(coin); + let userToRoast = message.content.split(" ").slice(1).join(" "); + let roasts = ["*puts you in the oven*", "You're so stupid.", "Sorry, I can't hear you over how annoying you are.", "I've got better things to do.", "You're as dumb as Cleverbot.", "Your IQ is lower than the Mariana Trench.", "You're so annoying even the flies stay away from your stench.", "Go away, please.", "I'd give you a nasty look but you've already got one.", "It looks like your face caught fire and someone tried to put it out with a hammer.", "Your family tree must be a cactus because everyone on it is a prick.", "Someday you will go far, and I hope you stay there.", "The zoo called. They're wondering how you got out of your cage.", "I was hoping for a battle of wits, but you appear to be unarmed.", "You are proof that evolution can go in reverse.", "Brains aren't everything, in your case, they're nothing.", "Sorry I didn't get that, I don't speak idiot.", "Why is it acceptable for you to be an idiot, but not for me to point it out?", "We all sprang from apes, but you did not spring far enough.", "You're an unknown command.", "If you could go anywhere I chose, I'd choose dead.", "Even monkeys can go to space, so clearly you lack some potential.", "It's brains over brawn, yet you have neither.", "You look like a monkey, and you smell like one too.", "Even among idiots you're lacking.", "You fail even when you're doing absolutely nothing.", "If there was a vote for 'least likely to succeed' you'd win first prize.", "I'm surrounded by idiots... Or, wait, that's just you.", "I wanna go home. Well, really I just want to get away from the awful aroma you've got going there.", "Every time you touch me I have to go home and wash all my clothes nine times just to get a normal smell back.", "If I had a nickel for every brain you don't have, I'd have one dollar.", "I'd help you succeed but you're incapable."]; + roasts = roasts[Math.floor(Math.random() * roasts.length)]; + if(userToRoast === '') { + message.reply(roasts); } else { - message.channel.send(username + ", " + coin); + message.channel.send(userToRoast + ", " + roasts); } } -} - -module.exports = RoastMeCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/rockpaperscissors.js b/commands/response/rockpaperscissors.js index eac027ab..ea4de0e8 100644 --- a/commands/response/rockpaperscissors.js +++ b/commands/response/rockpaperscissors.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class RockPaperScissors extends commando.Command { +module.exports = class RockPaperScissors extends commando.Command { constructor(Client){ super(Client, { - name: 'rps', + name: 'rps', + aliases: [ + 'rockpaperscissors' + ], group: 'response', memberName: 'rps', description: 'Play Rock Paper Scissors (;rps Rock)', @@ -11,10 +14,9 @@ class RockPaperScissors 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 [rps] = message.content.toLowerCase().split(" ").slice(1); @@ -56,6 +58,4 @@ class RockPaperScissors extends commando.Command { message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!"); } } -} - -module.exports = RockPaperScissors; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/roll.js b/commands/response/roll.js index bbaba010..09ab537d 100644 --- a/commands/response/roll.js +++ b/commands/response/roll.js @@ -1,9 +1,13 @@ const commando = require('discord.js-commando'); -class RollChooseCommand extends commando.Command { +module.exports = class RollChooseCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'roll', + name: 'roll', + aliases: [ + 'randomnumber', + 'dice' + ], group: 'response', memberName: 'roll', description: 'Rolls a Dice of your choice. (;roll 6)', @@ -11,16 +15,15 @@ class RollChooseCommand 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 [value] = message.content.split(" ").slice(1); if(value === undefined) { let roll = Math.floor(Math.random() * 6) + 1; - message.channel.send("You rolled a " + roll) + message.channel.send("You rolled a " + roll); } else if(value.match(/^[0-9]+$/)) { let roll = Math.floor(Math.random() * value) + 1; message.channel.send("You rolled a " + roll); @@ -28,6 +31,4 @@ class RollChooseCommand extends commando.Command { message.channel.send(":x: Error! Your message either contains a number but the number is invalid, or the number is in the wrong place.\n:notepad_spiral: (Note: When using numbers such as 1,000, do not use a comma)"); } } -} - -module.exports = RollChooseCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/roulette.js b/commands/response/roulette.js index 0edec6e9..a92f7532 100644 --- a/commands/response/roulette.js +++ b/commands/response/roulette.js @@ -1,9 +1,15 @@ const commando = require('discord.js-commando'); -class RouletteCommand extends commando.Command { +module.exports = class RouletteCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'roulette', + name: 'roulette', + aliases: [ + 'randommember', + 'randomuser', + 'pickmember', + 'pickuser' + ], group: 'response', memberName: 'roulette', description: 'Chooses a random member. (;roulette Who is the best?)', @@ -11,18 +17,15 @@ class RouletteCommand 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); - if(message.channel.type === 'dm') { - message.channel.send(':x: Error! This is a DM!'); - } else { + if(message.channel.type !== 'dm') { message.channel.send("I choose " + message.guild.members.random().displayName + "!"); + } else { + message.channel.send(':x: Error! This command does not work in DM!'); } } -} - -module.exports = RouletteCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/ship.js b/commands/response/ship.js index 1e65917f..e8d8aabb 100644 --- a/commands/response/ship.js +++ b/commands/response/ship.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class ShipCommand extends commando.Command { +module.exports = class ShipCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'ship', + name: 'ship', + aliases: [ + 'rate' + ], group: 'response', memberName: 'ship', description: 'Ships two people. (;ship @Rem and @Nate)', @@ -11,16 +14,13 @@ class ShipCommand 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 ship = message.content.split(" ").slice(1).join(" "); + let thingToShip = message.content.split(" ").slice(1).join(" "); let percentage = Math.floor(Math.random() * 100) + 1; - message.channel.send("I'd give " + ship + " a " + percentage + "%!"); + message.channel.send("I'd give " + thingToShip + " a " + percentage + "%!"); } -} - -module.exports = ShipCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/slots.js b/commands/response/slots.js index 2127057e..dde71d52 100644 --- a/commands/response/slots.js +++ b/commands/response/slots.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class SlotsCommand extends commando.Command { +module.exports = class SlotsCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'slots', + name: 'slots', group: 'response', memberName: 'slots', description: 'Play slots. (;slots)', @@ -11,10 +11,9 @@ class SlotsCommand 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 slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:']; @@ -28,6 +27,4 @@ class SlotsCommand extends commando.Command { message.channel.send(slotOne + '|' + slotTwo + '|' + slotThree + '|' + slotFour + "\nAww... You lost... Guess it's just bad luck, huh?"); } } -} - -module.exports = SlotsCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/vocaloid.js b/commands/response/vocaloid.js index c184da79..b2792d07 100644 --- a/commands/response/vocaloid.js +++ b/commands/response/vocaloid.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class VocaloidSongRndm extends commando.Command { +module.exports = class VocaloidSongRndm extends commando.Command { constructor(Client){ super(Client, { - name: 'vocaloid', + name: 'vocaloid', + aliases: [ + 'vocaloidsong' + ], group: 'response', memberName: 'vocaloid', description: 'Sends a random VOCALOID song. (;vocaloid)', @@ -11,16 +14,13 @@ class VocaloidSongRndm 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 = ["https://www.youtube.com/watch?v=ebAKoRcYFTA", "https://www.youtube.com/watch?v=Mqps4anhz0Q", "https://www.youtube.com/watch?v=AUEiHQOCQ2M", "https://www.youtube.com/watch?v=oyteTOBxRm8", "https://www.youtube.com/watch?v=uwwU55zBYlQ", "https://www.youtube.com/watch?v=sSYoz0JmnZo", "https://www.youtube.com/watch?v=NpU4dsXW6EI", "https://www.youtube.com/watch?v=MzyXD8bNbvk", "https://www.youtube.com/watch?v=hyV4qGAPKac", "https://www.youtube.com/watch?v=pywNi6gD1FA", "https://www.youtube.com/watch?v=17FEtaiWdVg", "https://www.youtube.com/watch?v=fmrA-gxJxgQ", "https://www.youtube.com/watch?v=yOBWgSPrYVA", "https://www.youtube.com/watch?v=nCaqf9WhqOY", "https://www.youtube.com/watch?v=cQKGUgOfD8U", "https://www.youtube.com/watch?v=sK92X82T3Sk", "https://www.youtube.com/watch?v=AH5_sKwDw1E", "https://www.youtube.com/watch?v=dw-KJNqcK-Q", "https://www.youtube.com/watch?v=X47JmmqbMvc", "https://www.youtube.com/watch?v=ojQPpYVQt7U", "https://www.amazon.com/Gogatsu-Yamai-feat-Kagamine-Len/dp/B00P1BG27S", "https://www.youtube.com/watch?v=N1-Z8uslIsI", "https://www.youtube.com/watch?v=EAgk-t2zzqw", "https://www.youtube.com/watch?v=uLBC2kWYFo8", "https://www.youtube.com/watch?v=OXHYIlkZLUU", "https://www.youtube.com/watch?v=ObIa9wXbyMQ", "https://www.youtube.com/watch?v=dGNoCICGmo0", "https://www.youtube.com/watch?v=LcoyEZkTKfY", "https://www.youtube.com/watch?v=mKHaW0qd5Mw", "https://www.youtube.com/watch?v=GG627DYk_E4", "https://www.youtube.com/watch?v=jTm6Q5Pj_Jo", "https://www.youtube.com/watch?v=TVeIDmk3rBo", "https://www.youtube.com/watch?v=1K3in6w9tt4", "https://www.youtube.com/watch?v=07r67gGbtLQ", "https://www.youtube.com/watch?v=243vPl8HdVk", "https://www.youtube.com/watch?v=zweVJrnE1uY", "https://www.youtube.com/watch?v=RKtoreimcQ8", "https://www.youtube.com/watch?v=Je6dCVfHvkU", "https://www.youtube.com/watch?v=UxFv12y_evM", "https://www.youtube.com/watch?v=2HegQtmJeto", "https://www.youtube.com/watch?v=8-Epnpruww0"]; - coin = coin[Math.floor(Math.random() * coin.length)]; - message.channel.send(coin); + let songs = ["https://www.youtube.com/watch?v=ebAKoRcYFTA", "https://www.youtube.com/watch?v=Mqps4anhz0Q", "https://www.youtube.com/watch?v=AUEiHQOCQ2M", "https://www.youtube.com/watch?v=oyteTOBxRm8", "https://www.youtube.com/watch?v=uwwU55zBYlQ", "https://www.youtube.com/watch?v=sSYoz0JmnZo", "https://www.youtube.com/watch?v=NpU4dsXW6EI", "https://www.youtube.com/watch?v=MzyXD8bNbvk", "https://www.youtube.com/watch?v=hyV4qGAPKac", "https://www.youtube.com/watch?v=pywNi6gD1FA", "https://www.youtube.com/watch?v=17FEtaiWdVg", "https://www.youtube.com/watch?v=fmrA-gxJxgQ", "https://www.youtube.com/watch?v=yOBWgSPrYVA", "https://www.youtube.com/watch?v=nCaqf9WhqOY", "https://www.youtube.com/watch?v=cQKGUgOfD8U", "https://www.youtube.com/watch?v=sK92X82T3Sk", "https://www.youtube.com/watch?v=AH5_sKwDw1E", "https://www.youtube.com/watch?v=dw-KJNqcK-Q", "https://www.youtube.com/watch?v=X47JmmqbMvc", "https://www.youtube.com/watch?v=ojQPpYVQt7U", "https://www.amazon.com/Gogatsu-Yamai-feat-Kagamine-Len/dp/B00P1BG27S", "https://www.youtube.com/watch?v=N1-Z8uslIsI", "https://www.youtube.com/watch?v=EAgk-t2zzqw", "https://www.youtube.com/watch?v=uLBC2kWYFo8", "https://www.youtube.com/watch?v=OXHYIlkZLUU", "https://www.youtube.com/watch?v=ObIa9wXbyMQ", "https://www.youtube.com/watch?v=dGNoCICGmo0", "https://www.youtube.com/watch?v=LcoyEZkTKfY", "https://www.youtube.com/watch?v=mKHaW0qd5Mw", "https://www.youtube.com/watch?v=GG627DYk_E4", "https://www.youtube.com/watch?v=jTm6Q5Pj_Jo", "https://www.youtube.com/watch?v=TVeIDmk3rBo", "https://www.youtube.com/watch?v=1K3in6w9tt4", "https://www.youtube.com/watch?v=07r67gGbtLQ", "https://www.youtube.com/watch?v=243vPl8HdVk", "https://www.youtube.com/watch?v=zweVJrnE1uY", "https://www.youtube.com/watch?v=RKtoreimcQ8", "https://www.youtube.com/watch?v=Je6dCVfHvkU", "https://www.youtube.com/watch?v=UxFv12y_evM", "https://www.youtube.com/watch?v=2HegQtmJeto", "https://www.youtube.com/watch?v=8-Epnpruww0"]; + songs = songs[Math.floor(Math.random() * songs.length)]; + message.channel.send(songs); } -} - -module.exports = VocaloidSongRndm; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/response/xiaopai.js b/commands/response/xiaopai.js index a0bbdcbf..026ef034 100644 --- a/commands/response/xiaopai.js +++ b/commands/response/xiaopai.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class RandomXiaoPai extends commando.Command { +module.exports = class RandomXiaoPai extends commando.Command { constructor(Client){ super(Client, { - name: 'xiaopai', + name: 'xiaopai', + aliases: [ + 'xiao' + ], group: 'response', memberName: 'xiaopai', description: 'Sends a random image of Xiao Pai. (;xiaopai)', @@ -11,17 +14,13 @@ class RandomXiaoPai 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); let XiaoPai = ["1.png", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.png", "9.png", "10.png", "11.png", "12.png", "13.jpg", "14.jpg", "15.png", "16.jpg", "17.png", "18.gif", "19.png", "20.jpg", "21.jpg"]; XiaoPai = XiaoPai[Math.floor(Math.random() * XiaoPai.length)]; message.channel.sendFile("./images/Xiao" + XiaoPai); } -} - -module.exports = RandomXiaoPai; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/cuddle.js b/commands/roleplay/cuddle.js index 5045c615..88767924 100644 --- a/commands/roleplay/cuddle.js +++ b/commands/roleplay/cuddle.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class CuddleCommand extends commando.Command { +module.exports = class CuddleCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'cuddle', + name: 'cuddle', group: 'roleplay', memberName: 'cuddle', description: 'Cuddles someone. (;cuddle @User)', @@ -11,15 +11,12 @@ class CuddleCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *cuddles* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *cuddles* ' + thingToRoleplay); } -} - -module.exports = CuddleCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/divorce.js b/commands/roleplay/divorce.js index ecfb178d..ebc439ee 100644 --- a/commands/roleplay/divorce.js +++ b/commands/roleplay/divorce.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class DivorceCommand extends commando.Command { +module.exports = class DivorceCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'divorce', + name: 'divorce', group: 'roleplay', memberName: 'divorce', description: 'Divorces someone. (;divorce @User)', @@ -11,15 +11,12 @@ class DivorceCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *divorces* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *divorces* ' + thingToRoleplay); } -} - -module.exports = DivorceCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/eat.js b/commands/roleplay/eat.js index 54b0ceda..ffbb5dd2 100644 --- a/commands/roleplay/eat.js +++ b/commands/roleplay/eat.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class EatCommand extends commando.Command { +module.exports = class EatCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'eat', + name: 'eat', group: 'roleplay', memberName: 'eat', description: 'Eats something/someone. (;eat @User)', @@ -11,15 +11,12 @@ class EatCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *eats* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *eats* ' + thingToRoleplay); } -} - -module.exports = EatCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/falconpunch.js b/commands/roleplay/falconpunch.js index 1b03400a..cd813581 100644 --- a/commands/roleplay/falconpunch.js +++ b/commands/roleplay/falconpunch.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class FalconPunchCommand extends commando.Command { +module.exports = class FalconPunchCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'falconpunch', + name: 'falconpunch', group: 'roleplay', memberName: 'falconpunch', description: 'Falcon Punches someone. (;falconpunch @User)', @@ -11,15 +11,12 @@ class FalconPunchCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *falcon punches* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *falcon punches* ' + thingToRoleplay); } -} - -module.exports = FalconPunchCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/fistbump.js b/commands/roleplay/fistbump.js index 720cee75..9e2ee814 100644 --- a/commands/roleplay/fistbump.js +++ b/commands/roleplay/fistbump.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class FistBumpCommand extends commando.Command { +module.exports = class FistBumpCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'fistbump', + name: 'fistbump', group: 'roleplay', memberName: 'fistbump', description: 'Fistbumps someone. (;fistbump @User)', @@ -11,15 +11,12 @@ class FistBumpCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *fistbumps* ' + username + ' *badalalala* '); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *fistbumps* ' + thingToRoleplay + ' *badalalala*'); } -} - -module.exports = FistBumpCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/highfive.js b/commands/roleplay/highfive.js index 2c8ba48a..5a6e7f10 100644 --- a/commands/roleplay/highfive.js +++ b/commands/roleplay/highfive.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class HighFivesCommand extends commando.Command { +module.exports = class HighFivesCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'highfive', + name: 'highfive', group: 'roleplay', memberName: 'highfive', description: 'High Fives someone. (;highfive @User)', @@ -11,15 +11,12 @@ class HighFivesCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *high fives* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *high fives* ' + thingToRoleplay); } -} - -module.exports = HighFivesCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/hitwithshovel.js b/commands/roleplay/hitwithshovel.js index cefe34ed..3cdf88bc 100644 --- a/commands/roleplay/hitwithshovel.js +++ b/commands/roleplay/hitwithshovel.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class HitwithShovelCommand extends commando.Command { +module.exports = class HitwithShovelCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'hitwithshovel', + name: 'hitwithshovel', group: 'roleplay', memberName: 'hitwithsovel', description: 'Hits someone with a shovel. (;hitwithshovel @User)', @@ -11,15 +11,12 @@ class HitwithShovelCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *hits* ' + username + ' *with a shovel* '); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *hits* ' + thingToRoleplay + ' *with a shovel* '); } -} - -module.exports = HitwithShovelCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/hug.js b/commands/roleplay/hug.js index 5916aca2..74b53b2b 100644 --- a/commands/roleplay/hug.js +++ b/commands/roleplay/hug.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class HugCommand extends commando.Command { +module.exports = class HugCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'hug', + name: 'hug', group: 'roleplay', memberName: 'hug', description: 'Hugs someone. (;hug @User)', @@ -11,15 +11,12 @@ class HugCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *hugs* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *hugs* ' + thingToRoleplay); } -} - -module.exports = HugCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/inhales.js b/commands/roleplay/inhales.js index 213b2949..7294d9e4 100644 --- a/commands/roleplay/inhales.js +++ b/commands/roleplay/inhales.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class InhaleCommand extends commando.Command { +module.exports = class InhaleCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'inhale', + name: 'inhale', group: 'roleplay', memberName: 'inhale', description: 'Inhales someone. (;inhale @User)', @@ -11,15 +11,12 @@ class InhaleCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *inhales* ' + username + ' *but gained no ability...* '); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *inhales* ' + thingToRoleplay + ' *but gained no ability...* '); } -} - -module.exports = InhaleCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/kill.js b/commands/roleplay/kill.js index d9ba811f..c2c09071 100644 --- a/commands/roleplay/kill.js +++ b/commands/roleplay/kill.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class KillCommand extends commando.Command { +module.exports = class KillCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'kill', + name: 'kill', group: 'roleplay', memberName: 'kill', description: 'Kills someone. (;kill @User)', @@ -11,15 +11,12 @@ class KillCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *kills* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *kills* ' + thingToRoleplay); } -} - -module.exports = KillCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/kiss.js b/commands/roleplay/kiss.js index 53541cc3..21f2cb1d 100644 --- a/commands/roleplay/kiss.js +++ b/commands/roleplay/kiss.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class KissCommand extends commando.Command { +module.exports = class KissCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'kiss', + name: 'kiss', group: 'roleplay', memberName: 'kiss', description: 'Kisses someone. (;kiss @User)', @@ -11,15 +11,12 @@ class KissCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *kisses* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *kisses* ' + thingToRoleplay); } -} - -module.exports = KissCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/marries.js b/commands/roleplay/marries.js index 1d6d9a2f..ba524bc2 100644 --- a/commands/roleplay/marries.js +++ b/commands/roleplay/marries.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class MarryCommand extends commando.Command { +module.exports = class MarryCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'marry', + name: 'marry', group: 'roleplay', memberName: 'marry', description: 'Marries someone. (;marry @User)', @@ -11,15 +11,12 @@ class MarryCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *marries* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *marries* ' + thingToRoleplay); } -} - -module.exports = MarryCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/pat.js b/commands/roleplay/pat.js index 8d40f929..428ba182 100644 --- a/commands/roleplay/pat.js +++ b/commands/roleplay/pat.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class PatCommand extends commando.Command { +module.exports = class PatCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'pat', + name: 'pat', group: 'roleplay', memberName: 'pat', description: 'Pats someone. (;pat @User)', @@ -11,15 +11,12 @@ class PatCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *pats* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *pats* ' + thingToRoleplay); } -} - -module.exports = PatCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/poke.js b/commands/roleplay/poke.js index ce44cb2a..4d4b9d4b 100644 --- a/commands/roleplay/poke.js +++ b/commands/roleplay/poke.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class PokeCommand extends commando.Command { +module.exports = class PokeCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'poke', + name: 'poke', group: 'roleplay', memberName: 'poke', description: 'Pokes someone. (;poke @User)', @@ -11,15 +11,12 @@ class PokeCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *pokes* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *pokes* ' + thingToRoleplay); } -} - -module.exports = PokeCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/punch.js b/commands/roleplay/punch.js index 4f0949fb..a3c1f79c 100644 --- a/commands/roleplay/punch.js +++ b/commands/roleplay/punch.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class PunchCommand extends commando.Command { +module.exports = class PunchCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'punch', + name: 'punch', group: 'roleplay', memberName: 'punch', description: 'Punches someone. (;punch @User)', @@ -11,15 +11,12 @@ class PunchCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *punches* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *punches* ' + thingToRoleplay); } -} - -module.exports = PunchCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/roleplay/slap.js b/commands/roleplay/slap.js index 387f7c47..5a7929bb 100644 --- a/commands/roleplay/slap.js +++ b/commands/roleplay/slap.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class SlapCommand extends commando.Command { +module.exports = class SlapCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'slap', + name: 'slap', group: 'roleplay', memberName: 'slap', description: 'Slaps someone. (;slap @User)', @@ -11,15 +11,12 @@ class SlapCommand 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 username = message.content.split(" ").slice(1).join(" "); - message.channel.send(message.author + ' *slaps* ' + username); + let thingToRoleplay = message.content.split(" ").slice(1).join(" "); + message.channel.send(message.author + ' *slaps* ' + thingToRoleplay); } -} - -module.exports = SlapCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index 77f504a0..577e6e87 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -1,12 +1,16 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); const config = require('../../config.json'); -class BotSearchCommand extends commando.Command { +module.exports = class BotSearchCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'botinfo', + name: 'botinfo', + aliases: [ + 'bot', + 'botdata' + ], group: 'search', memberName: 'botinfo', description: 'Searches Discord Bots for info on a bot. (;botinfo @Bot)', @@ -14,44 +18,35 @@ class BotSearchCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); if(message.mentions.users.size === 1) { let botToFind = message.mentions.users.first().id; - const options = { - method: 'GET', - uri: 'https://bots.discord.pw/api/bots/' + botToFind, - headers: { - 'Authorization': config.botskey - }, - json: true - } - request(options).then(function (response) { + request + .get('https://bots.discord.pw/api/bots/' + botToFind) + .set({ 'Authorization': config.botskey }) + .then(function (response) { const embed = new Discord.RichEmbed() .setColor(0x9797FF) .setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg') - .setTitle(response.name) + .setTitle(response.body.name) .setURL('https://bots.discord.pw/') - .setDescription(response.description) + .setDescription(response.body.description) .addField('**Library:**', - response.library, true) + response.body.library, true) .addField('**Prefix:**', - response.prefix, true) + response.body.prefix, true) .addField('**Invite:**', - '[Here](' + response.invite_url + ')', true); + '[Here](' + response.body.invite_url + ')', true); message.channel.sendEmbed(embed).catch(console.error); }).catch(function (err) { message.channel.send(":x: Error! Bot not Found!"); }); } else { - message.channel.send(':x: Either too many or no bots, only mention one bot!'); + message.channel.send(':x: Please mention one bot!'); } } -} - -module.exports = BotSearchCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/define.js b/commands/search/define.js index 34625981..8642a740 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -1,12 +1,18 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); const config = require('../../config.json'); -class DefineCommand extends commando.Command { +module.exports = class DefineCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'define', + name: 'define', + aliases: [ + 'definition', + 'defineword', + 'dictionary', + 'wordnik' + ], group: 'search', memberName: 'define', description: 'Defines a word. (;define Cat)', @@ -14,36 +20,23 @@ class DefineCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let definethis = message.content.toLowerCase().split(" ").slice(1).join("%20"); - const options = { - method: 'GET', - uri: 'http://api.wordnik.com:80/v4/word.json/' + definethis + '/definitions', - qs: { - limit: 1, - includeRelated: false, - useCanonical: false, - includeTags: false, - api_key: config.wordnikkey - }, - json: true - } - request(options).then(function (response) { + let defineThis = message.content.toLowerCase().split(" ").slice(1).join("%20"); + request + .get('http://api.wordnik.com:80/v4/word.json/' + defineThis + '/definitions') + .query({ limit: 1, includeRelated: false, useCanonical: false, includeTags: false, api_key: config.wordnikkey }) + .then(function (response) { const embed = new Discord.RichEmbed() .setColor(0x9797FF) - .setTitle(response[0].word) - .setDescription(response[0].text); + .setTitle(response.body[0].word) + .setDescription(response.body[0].text); message.channel.sendEmbed(embed).catch(console.error); }).catch(function (err) { message.channel.send(":x: Error! Word not Found!"); }); } -} - -module.exports = DefineCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/discrim.js b/commands/search/discrim.js index f7dcf872..62518739 100644 --- a/commands/search/discrim.js +++ b/commands/search/discrim.js @@ -1,10 +1,14 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class DiscrimCommand extends commando.Command { +module.exports = class DiscrimCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'discrim', + name: 'discrim', + aliases: [ + 'discriminator', + 'searchdiscrim' + ], group: 'search', memberName: 'discrim', description: 'Searches the server for a certain discriminator. (;discrim 8081)', @@ -12,11 +16,9 @@ class DiscrimCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); let userToSearch = message.content.split(" ").slice(1).join(" "); @@ -30,6 +32,4 @@ class DiscrimCommand extends commando.Command { message.channel.send(':x: Error! This discriminator is invalid!'); } } -} - -module.exports = DiscrimCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/forecast.js b/commands/search/forecast.js index f4b9b142..6fd6f40d 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -2,10 +2,13 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const weather = require('yahoo-weather'); -class ForecastCommand extends commando.Command { +module.exports = class ForecastCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'forecast', + name: 'forecast', + aliases: [ + 'weatherforecast' + ], group: 'search', memberName: 'forecast', description: 'Gets the seven-day forecast for a specified location. (;forecast San Francisco)', @@ -13,15 +16,13 @@ class ForecastCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let locationtosearch = message.content.split(" ").slice(1).join(" "); - weather(locationtosearch, 'f').then(info => { + let locationToSearch = message.content.split(" ").slice(1).join(" "); + weather(locationToSearch, 'f').then(info => { const embed = new Discord.RichEmbed() .setColor(0x0000FF) .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') @@ -46,6 +47,4 @@ class ForecastCommand extends commando.Command { message.channel.send(":x: Error! Make sure you typed the location correctly!"); }); } -} - -module.exports = ForecastCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/imdb.js b/commands/search/imdb.js index 0dea51d5..d5c62d45 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -2,10 +2,15 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const imdb = require('imdb-api'); -class IMDBCommand extends commando.Command { +module.exports = class IMDBCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'imdb', + name: 'imdb', + aliases: [ + 'movie', + 'tvshow', + 'film' + ], group: 'search', memberName: 'imdb', description: 'Searches IMDB for a specified movie. (;imdb How to Train Your Dragon)', @@ -13,17 +18,15 @@ class IMDBCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let querymovie = message.content.split(" ").slice(1).join(" "); + let queryMovie = message.content.split(" ").slice(1).join(" "); let movie; - imdb.getReq({ name: querymovie }, (err, things) => { - movie = things; + imdb.getReq({ name: queryMovie }, (err, response) => { + movie = response; if(movie === undefined) { message.channel.send(":x: Error! Movie not found!"); } else { @@ -51,6 +54,4 @@ class IMDBCommand extends commando.Command { } }); } -} - -module.exports = IMDBCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/neopet.js b/commands/search/neopet.js index 6d7ceff1..3dc3eaf5 100644 --- a/commands/search/neopet.js +++ b/commands/search/neopet.js @@ -1,30 +1,26 @@ const commando = require('discord.js-commando'); -class NeopetCommand extends commando.Command { +module.exports = class NeopetCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'neopet', + name: 'neopet', group: 'search', memberName: 'neopet', - description: "Gives a Neopet's image, searchable by ID. (;neopet rjwlsb8k) (;neopet getID for help on getting your Pet's ID)", - examples: [';neopet rjwlsb8k'] + description: "Gives a Neopet's image, searchable by ID. (;neopet rjwlsb8k)", + examples: [';neopet rjwlsb8k', ';neopet getID'] }); } - 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('ATTACH_FILES')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log("[Command] " + message.content); - let [petID] = message.content.split(" ").slice(1); - if(petID === "getID") { + let petID = message.content.toLowerCase().split(" ").slice(1).join(" "); + if(petID === "getid") { message.channel.send("To get your pet's ID, simply go to http://www.sunnyneo.com/petimagefinder.php and enter your pet's name. It's image should show up. Then, find the link below the pet's image, and copy it to your message!").then(message.channel.sendFile('./images/PetID.png').then(message.channel.send("It's recommended you keep this ID with you so you can easily share your pet's picture without having to repeat these steps."))); } else { - message.channel.send("Result for: " + petID).then(message.channel.sendFile('http://pets.neopets.com/cp/' + petID + '/1/5.png').catch(error => message.channel.send(":x: Error! Pet ID Not Found!\n:notepad_spiral: Note: This command is subject to something of a ratelimit. Try again soon if you're sure your ID is valid."))); + message.channel.send("Result for: " + petID).then(message.channel.sendFile('http://pets.neopets.com/cp/' + petID + '/1/5.png').catch(error => message.channel.send(":x: Error! Pet ID Not Found! Use `;neopet getID` for help on getting your pet ID."))); } } -} - -module.exports = NeopetCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/osu.js b/commands/search/osu.js index 5bc7cc8c..019a0660 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -1,12 +1,17 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const config = require('../../config.json'); -const request = require('request-promise'); +const request = require('superagent'); -class OsuCommand extends commando.Command { +module.exports = class OsuCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'osu', + name: 'osu', + aliases: [ + 'osuuser', + 'osudata', + 'osuinfo' + ], group: 'search', memberName: 'osu', description: 'Searches Osu user data. (;osu dragonfire535)', @@ -14,25 +19,16 @@ class OsuCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let usernametosearch = message.content.split(" ").slice(1).join(" "); - const options = { - method: 'GET', - uri: 'https://osu.ppy.sh/api/get_user', - qs: { - k: config.osukey, - u: usernametosearch, - type: "string" - }, - json: true - } - request(options).then(function (response) { + let usernameToSearch = message.content.split(" ").slice(1).join(" "); + request + .get('https://osu.ppy.sh/api/get_user') + .query({ k: config.osukey, u: usernameToSearch, type: 'string' }) + .then(function (response) { if(response[0] === undefined) { message.channel.send(":x: Error! User not found!"); } else { @@ -70,6 +66,4 @@ class OsuCommand extends commando.Command { message.channel.send(":x: Error! User not Found!"); }); } -} - -module.exports = OsuCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/pkdex.json b/commands/search/pkdex.json index fa1c3283..52291144 100644 --- a/commands/search/pkdex.json +++ b/commands/search/pkdex.json @@ -1,259 +1,509 @@ { - "dexicon": "http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pokédex.png/250px-479Rotom-Pokédex.png", - "dexname": "Pokédex", + "index": { + "bulbasaur": "001", + "ivysaur": "002", + "venusaur": "003", + "charmander": "004", + "charmeleon": "005", + "charizard": "006", + "squirtle": "007", + "wartortle": "008", + "blastoise": "009", + "caterpie": "010", + "metapod": "011", + "butterfree": "012", + "weedle": "013", + "kakuna": "014", + "beedrill": "015", + "pidgey": "016", + "pidgeotto": "017", + "pidgeot": "018", + "rattata": "019", + "raticate": "020", + "spearow": "021", + "fearow": "022", + "ekans": "023", + "arbok": "024", + "pikachu": "025", + "raichu": "026", + "sandshrew": "027", + "sandslash": "028", + "nidoranf": "029", + "nidorina": "030", + "nidoqueen": "031", + "nidoranm": "032", + "nidorino": "033", + "nidoking": "034", + "clefairy": "035", + "clefable": "036", + "vulpix": "037", + "ninetales": "038", + "jigglypuff": "039", + "wigglytuff": "040", + "zubat": "041", + "golbat": "042", + "oddish": "043", + "gloom": "044 Gloom", + "vileplume": "045", + "paras": "046", + "parasect": "047", + "venonat": "048", + "venomoth": "049", + "diglett": "050", + "dugtrio": "051", + "meowth": "052", + "persian": "053", + "psyduck": "054", + "golduck": "055", + "mankey": "056", + "primeape": "057", + "growlithe": "058", + "arcanine": "059", + "poliwag": "060", + "poliwhirl": "061", + "poliwrath": "062", + "abra": "063", + "kadabra": "064", + "alakazam": "065", + "machop": "066", + "machoke": "067", + "machamp": "068", + "bellsprout": "069", + "weepinbell": "070", + "victreebel": "071", + "tentacool": "072", + "tentacruel": "073", + "geodude": "074", + "graveler": "075", + "golem": "076", + "ponyta": "077", + "rapidash": "078", + "slowpoke": "079", + "slowbro": "080", + "magnemite": "081", + "magneton": "082", + "farfetch'd": "083", + "doduo": "084", + "dodrio": "085", + "seel": "086", + "dewgong": "087", + "grimer": "088", + "muk": "089", + "shellder": "090", + "cloyster": "091", + "gastly": "092", + "haunter": "093", + "gengar": "094", + "onix": "095", + "drowzee": "096", + "hypno": "097", + "krabby": "098", + "kingler": "099", + "voltorb": "100", + "electrode": "101", + "exeggcute": "102", + "exeggutor": "103", + "cubone": "104", + "marowak": "105", + "hitmonlee": "106", + "hitmonchan": "107", + "lickitung": "108", + "koffing": "109", + "weezing": "110", + "rhyhorn": "111", + "rhydon": "112", + "chansey": "113", + "tangela": "114", + "kangaskhan": "115", + "horsea": "116", + "seadra": "117", + "goldeen": "118", + "seaking": "119", + "staryu": "120", + "starmie": "121", + "mr. mime": "122", + "scyther": "123", + "jynx": "124", + "electabuzz": "125", + "magmar": "126", + "pinsir": "127", + "tauros": "128", + "magikarp": "129", + "gyarados": "130", + "lapras": "131", + "ditto": "132", + "eevee": "133", + "vaporeon": "134", + "jolteon": "135", + "flareon": "136", + "porygon": "137", + "omanyte": "138", + "omastar": "139", + "kabuto": "140", + "kabutops": "141", + "aerodactyl": "142", + "snorlax": "143", + "articuno": "144", + "zapdos": "145", + "moltres": "146", + "dratini": "147", + "dragonair": "148", + "dragonite": "149", + "mewtwo": "150", + "mew": "151", + "chikorita": "152", + "bayleef": "153", + "meganium": "154", + "cyndaquil": "155", + "quilava": "156", + "typhlosion": "157", + "totodile": "158", + "croconaw": "159", + "feraligatr": "160", + "sentret": "161", + "furret": "162", + "hoothoot": "163", + "noctowl": "164", + "ledyba": "165", + "ledian": "166", + "spinarak": "167", + "ariados": "168", + "crobat": "169", + "chinchou": "170", + "lanturn": "171", + "pichu": "172", + "cleffa": "173", + "igglybuff": "174", + "togepi": "175", + "togetic": "176", + "natu": "177", + "xatu": "178", + "mareep": "179", + "flaaffy": "180", + "ampharos": "181", + "bellossom": "182", + "marill": "183", + "azumarill": "184", + "sudowoodo": "185", + "politoed": "186", + "hoppip": "187", + "skiploom": "188", + "jumpluff": "189", + "aipom": "190", + "sunkern": "191", + "sunflora": "192", + "yanma": "193", + "wooper": "194", + "quagsire": "195", + "espeon": "196", + "umbreon": "197", + "murkrow": "198", + "slowking": "199", + "misdreavus": "200", + "unown": "201", + "wobbuffet": "202", + "girafarig": "203", + "pineco": "204", + "forretress": "205", + "dunsparce": "206", + "gligar": "207", + "steelix": "208", + "snubbull": "209", + "granbull": "210", + "qwilfish": "211", + "scizor": "212", + "shuckle": "213", + "heracross": "214", + "sneasel": "215", + "teddiursa": "216", + "ursaring": "217", + "slugma": "218", + "magcargo": "219", + "swinub": "220", + "piloswine": "221", + "corsola": "222", + "remoraid": "223", + "octillery": "224", + "delibird": "225", + "mantine": "226", + "skarmory": "227", + "houndour": "228", + "houndoom": "229", + "kingdra": "230", + "phanpy": "231", + "donphan": "232", + "porygon2": "233", + "stantler": "234", + "smeargle": "235", + "tyrogue": "236", + "hitmontop": "237", + "smoochum": "238", + "elekid": "239", + "magby": "240", + "miltank": "241", + "blissey": "242", + "raikou": "243", + "entei": "244", + "suicune": "245", + "larvitar": "246", + "pupitar": "247", + "tyranitar": "248", + "lugia": "249", + "ho-oh": "250", + "celebi": "251" + }, "name": { - "bulbasaur": "#001 Bulbasaur", - "ivysaur": "#002 Ivysaur", - "venusaur": "#003 Venusaur", - "charmander": "#004 Charmander", - "charmeleon": "#005 Charmeleon", - "charizard": "#006 Charizard", - "squirtle": "#007 Squirtle", - "wartortle": "#008 Wartortle", - "blastoise": "#009 Blastoise", - "caterpie": "#010 Caterpie", - "metapod": "#011 Metapod", - "butterfree": "#012 Butterfree", - "weedle": "#013 Weedle", - "kakuna": "#014 Kakuna", - "beedrill": "#015 Beedrill", - "pidgey": "#016 Pidgey", - "pidgeotto": "#017 Pidgeotto", - "pidgeot": "#018 Pidgeot", - "rattata": "#019 Rattata", - "raticate": "#020 Raticate", - "spearow": "#021 Spearow", - "fearow": "#022 Fearow", - "ekans": "#023 Ekans", - "arbok": "#024 Arbok", - "pikachu": "#025 Pikachu", - "raichu": "#026 Raichu", - "sandshrew": "#027 Sandshrew", - "sandslash": "#028 Sandslash", - "nidoranf": "#029 NidoranF", - "nidorina": "#030 Nidorina", - "nidoqueen": "#031 Nidoqueen", - "nidoranm": "#032 NidoranM", - "nidorino": "#033 Nidorino", - "nidoking": "#034 Nidoking", - "clefairy": "#035 Clefairy", - "clefable": "#036 Clefable", - "vulpix": "#037 Vulpix", - "ninetales": "#038 Ninetales", - "jigglypuff": "#039 Jigglypuff", - "wigglytuff": "#040 Wigglytuff", - "zubat": "#041 Zubat", - "golbat": "#042 Golbat", - "oddish": "#043 Oddish", - "gloom": "#044 Gloom", - "vileplume": "#045 Vileplume", - "paras": "#046 Paras", - "parasect": "#047 Parasect", - "venonat": "#048 Venonat", - "venomoth": "#049 Venomoth", - "diglett": "#050 Diglett", - "dugtrio": "#051 Dugtrio", - "meowth": "#052 Meowth", - "persian": "#053 Persian", - "psyduck": "#054 Psyduck", - "golduck": "#055 Golduck", - "mankey": "#056 Mankey", - "primeape": "#057 Primeape", - "growlithe": "#058 Growlithe", - "arcanine": "#059 Arcanine", - "poliwag": "#060 Poliwag", - "poliwhirl": "#061 Poliwhirl", - "poliwrath": "#062 Poliwrath", - "abra": "#063 Abra", - "kadabra": "#064 Kadabra", - "alakazam": "#065 Alakazam", - "machop": "#066 Machop", - "machoke": "#067 Machoke", - "machamp": "#068 Machamp", - "bellsprout": "#069 Bellsprout", - "weepinbell": "#070 Weepinbell", - "victreebel": "#071 Victreebel", - "tentacool": "#072 Tentacool", - "tentacruel": "#073 Tentacruel", - "geodude": "#074 Geodude", - "graveler": "#075 Graveler", - "golem": "#076 Golem", - "ponyta": "#077 Ponyta", - "rapidash": "#078 Rapidash", - "slowpoke": "#079 Slowpoke", - "slowbro": "#080 Slowbro", - "magnemite": "#081 Magnemite", - "magneton": "#082 Magneton", - "farfetch'd": "#083 Farfetch'd", - "doduo": "#084 Doduo", - "dodrio": "#085 Dodrio", - "seel": "#086 Seel", - "dewgong": "#087 Dewgong", - "grimer": "#088 Grimer", - "muk": "#089 Muk", - "shellder": "#090 Shellder", - "cloyster": "#091 Cloyster", - "gastly": "#092 Gastly", - "haunter": "#093 Haunter", - "gengar": "#094 Gengar", - "onix": "#095 Onix", - "drowzee": "#096 Drowzee", - "hypno": "#097 Hypno", - "krabby": "#098 Krabby", - "kingler": "#099 Kingler", - "voltorb": "#100 Voltorb", - "electrode": "#101 Electrode", - "exeggcute": "#102 Exeggcute", - "exeggutor": "#103 Exeggutor", - "cubone": "#104 Cubone", - "marowak": "#105 Marowak", - "hitmonlee": "#106 Hitmonlee", - "hitmonchan": "#107 Hitmonchan", - "lickitung": "#108 Lickitung", - "koffing": "#109 Koffing", - "weezing": "#110 Weezing", - "rhyhorn": "#111 Rhyhorn", - "rhydon": "#112 Rhydon", - "chansey": "#113 Chansey", - "tangela": "#114 Tangela", - "kangaskhan": "#115 Kangaskhan", - "horsea": "#116 Horsea", - "seadra": "#117 Seadra", - "goldeen": "#118 Goldeen", - "seaking": "#119 Seaking", - "staryu": "#120 Staryu", - "starmie": "#121 Starmie", - "mr. mime": "#122 Mr. Mime", - "scyther": "#123 Scyther", - "jynx": "#124 Jynx", - "electabuzz": "#125 Electabuzz", - "magmar": "#126 Magmar", - "pinsir": "#127 Pinsir", - "tauros": "#128 Tauros", - "magikarp": "#129 Magikarp", - "gyarados": "#130 Gyarados", - "lapras": "#131 Lapras", - "ditto": "#132 Ditto", - "eevee": "#133 Eevee", - "vaporeon": "#134 Vaporeon", - "jolteon": "#135 Jolteon", - "flareon": "#136 Flareon", - "porygon": "#137 Porygon", - "omanyte": "#138 Omanyte", - "omastar": "#139 Omastar", - "kabuto": "#140 Kabuto", - "kabutops": "#141 Kabutops", - "aerodactyl": "#142 Aerodactyl", - "snorlax": "#143 Snorlax", - "articuno": "#144 Articuno", - "zapdos": "#145 Zapdos", - "moltres": "#146 Moltres", - "dratini": "#147 Dratini", - "dragonair": "#148 Dragonair", - "dragonite": "#149 Dragonite", - "mewtwo": "#150 Mewtwo", - "mew": "#151 Mew", - "missingno.": "#??? MISSINGNO.", - "chikorita": "#152 Chikorita", - "bayleef": "#153 Bayleef", - "meganium": "#154 Meganium", - "cyndaquil": "#155 Cyndaquil", - "quilava": "#156 Quilava", - "typhlosion": "#157 Typhlosion", - "totodile": "#158 Totodile", - "croconaw": "#159 Croconaw", - "feraligatr": "#160 Feraligatr", - "sentret": "#161 Sentret", - "furret": "#162 Furret", - "hoothoot": "#163 Hoothoot", - "noctowl": "#164 Noctowl", - "ledyba": "#165 Ledyba", - "ledian": "#166 Ledian", - "spinarak": "#167 Spinarak", - "ariados": "#168 Ariados", - "crobat": "#169 Crobat", - "chinchou": "#170 Chinchou", - "lanturn": "#171 Lanturn", - "pichu": "#172 Pichu", - "cleffa": "#173 Cleffa", - "igglybuff": "#174 Igglybuff", - "togepi": "#175 Togepi", - "togetic": "#176 Togetic", - "natu": "#177 Natu", - "xatu": "#178 Xatu", - "mareep": "#179 Mareep", - "flaaffy": "#180 Flaaffy", - "ampharos": "#181 Ampharos", - "bellossom": "#182 Bellossom", - "marill": "#183 Marill", - "azumarill": "#184 Azumarill", - "sudowoodo": "#185 Sudowoodo", - "politoed": "#186 Politoed", - "hoppip": "#187 Hoppip", - "skiploom": "#188 Skiploom", - "jumpluff": "#189 Jumpluff", - "aipom": "#190 Aipom", - "sunkern": "#191 Sunkern", - "sunflora": "#192 Sunflora", - "yanma": "#193 Yanma", - "wooper": "#194 Wooper", - "quagsire": "#195 Quagsire", - "espeon": "#196 Espeon", - "umbreon": "#197 Umbreon", - "murkrow": "#198 Murkrow", - "slowking": "#199 Slowking", - "misdreavus": "#200 Misdreavus", - "unown": "#201 Unown", - "wobbuffet": "#202 Wobbuffet", - "girafarig": "#203 Girafarig", - "pineco": "#204 Pineco", - "forretress": "#205 Forretress", - "dunsparce": "#206 Dunsparce", - "gligar": "#207 Gligar", - "steelix": "#208 Steelix", - "snubbull": "#209 Snubbull", - "granbull": "#210 Granbull", - "qwilfish": "#211 Qwilfish", - "scizor": "#212 Scizor", - "shuckle": "#213 Shuckle", - "heracross": "#214 Heracross", - "sneasel": "#215 Sneasel", - "teddiursa": "#216 Teddiursa", - "ursaring": "#217 Ursaring", - "slugma": "#218 Slugma", - "magcargo": "#219 Magcargo", - "swinub": "#220 Swinub", - "piloswine": "#221 Piloswine", - "corsola": "#222 Corsola", - "remoraid": "#223 Remoraid", - "octillery": "#224 Octillery", - "delibird": "#225 Delibird", - "mantine": "#226 Mantine", - "skarmory": "#227 Skarmory", - "houndour": "#228 Houndour", - "houndoom": "#229 Houndoom", - "kingdra": "#230 Kingdra", - "phanpy": "#231 Phanpy", - "donphan": "#232 Donphan", - "porygon2": "#233 Porygon2", - "stantler": "#234 Stantler", - "smeargle": "#235 Smeargle", - "tyrogue": "#236 Tyrogue", - "hitmontop": "#237 Hitmontop", - "smoochum": "#238 Smoochum", - "elekid": "#239 Elekid", - "magby": "#240 Magby", - "miltank": "#241 Miltank", - "blissey": "#242 Blissey", - "raikou": "#243 Raikou", - "entei": "#244 Entei", - "suicune": "#245 Suicune", - "larvitar": "#246 Larvitar", - "pupitar": "#247 Pupitar", - "tyranitar": "#248 Tyranitar", - "lugia": "#249 Lugia", - "ho-oh": "#250 Ho-Oh", - "celebi": "#251 Celebi" + "bulbasaur": "Bulbasaur", + "ivysaur": "Ivysaur", + "venusaur": "Venusaur", + "charmander": "Charmander", + "charmeleon": "Charmeleon", + "charizard": "Charizard", + "squirtle": "Squirtle", + "wartortle": "Wartortle", + "blastoise": "Blastoise", + "caterpie": "Caterpie", + "metapod": "Metapod", + "butterfree": "Butterfree", + "weedle": "Weedle", + "kakuna": "Kakuna", + "beedrill": "Beedrill", + "pidgey": "Pidgey", + "pidgeotto": "Pidgeotto", + "pidgeot": "Pidgeot", + "rattata": "Rattata", + "raticate": "Raticate", + "spearow": "Spearow", + "fearow": "Fearow", + "ekans": "Ekans", + "arbok": "Arbok", + "pikachu": "Pikachu", + "raichu": "Raichu", + "sandshrew": "Sandshrew", + "sandslash": "Sandslash", + "nidoranf": "NidoranF", + "nidorina": "Nidorina", + "nidoqueen": "Nidoqueen", + "nidoranm": "NidoranM", + "nidorino": "Nidorino", + "nidoking": "Nidoking", + "clefairy": "Clefairy", + "clefable": "Clefable", + "vulpix": "Vulpix", + "ninetales": "Ninetales", + "jigglypuff": "Jigglypuff", + "wigglytuff": "Wigglytuff", + "zubat": "Zubat", + "golbat": "Golbat", + "oddish": "Oddish", + "gloom": "Gloom", + "vileplume": "Vileplume", + "paras": "Paras", + "parasect": "Parasect", + "venonat": "Venonat", + "venomoth": "Venomoth", + "diglett": "Diglett", + "dugtrio": "Dugtrio", + "meowth": "Meowth", + "persian": "Persian", + "psyduck": "Psyduck", + "golduck": "Golduck", + "mankey": "Mankey", + "primeape": "Primeape", + "growlithe": "Growlithe", + "arcanine": "Arcanine", + "poliwag": "Poliwag", + "poliwhirl": "Poliwhirl", + "poliwrath": "Poliwrath", + "abra": "Abra", + "kadabra": "Kadabra", + "alakazam": "Alakazam", + "machop": "Machop", + "machoke": "Machoke", + "machamp": "Machamp", + "bellsprout": "Bellsprout", + "weepinbell": "Weepinbell", + "victreebel": "Victreebel", + "tentacool": "Tentacool", + "tentacruel": "Tentacruel", + "geodude": "Geodude", + "graveler": "Graveler", + "golem": "Golem", + "ponyta": "Ponyta", + "rapidash": "Rapidash", + "slowpoke": "Slowpoke", + "slowbro": "Slowbro", + "magnemite": "Magnemite", + "magneton": "Magneton", + "farfetch'd": "Farfetch'd", + "doduo": "Doduo", + "dodrio": "Dodrio", + "seel": "Seel", + "dewgong": "Dewgong", + "grimer": "Grimer", + "muk": "Muk", + "shellder": "Shellder", + "cloyster": "Cloyster", + "gastly": "Gastly", + "haunter": "Haunter", + "gengar": "Gengar", + "onix": "Onix", + "drowzee": "Drowzee", + "hypno": "Hypno", + "krabby": "Krabby", + "kingler": "Kingler", + "voltorb": "Voltorb", + "electrode": "Electrode", + "exeggcute": "Exeggcute", + "exeggutor": "Exeggutor", + "cubone": "Cubone", + "marowak": "Marowak", + "hitmonlee": "Hitmonlee", + "hitmonchan": "Hitmonchan", + "lickitung": "Lickitung", + "koffing": "Koffing", + "weezing": "Weezing", + "rhyhorn": "Rhyhorn", + "rhydon": "Rhydon", + "chansey": "Chansey", + "tangela": "Tangela", + "kangaskhan": "Kangaskhan", + "horsea": "Horsea", + "seadra": "Seadra", + "goldeen": "Goldeen", + "seaking": "Seaking", + "staryu": "Staryu", + "starmie": "Starmie", + "mr. mime": "Mr. Mime", + "scyther": "Scyther", + "jynx": "Jynx", + "electabuzz": "Electabuzz", + "magmar": "Magmar", + "pinsir": "Pinsir", + "tauros": "Tauros", + "magikarp": "Magikarp", + "gyarados": "Gyarados", + "lapras": "Lapras", + "ditto": "Ditto", + "eevee": "Eevee", + "vaporeon": "Vaporeon", + "jolteon": "Jolteon", + "flareon": "Flareon", + "porygon": "Porygon", + "omanyte": "Omanyte", + "omastar": "Omastar", + "kabuto": "Kabuto", + "kabutops": "Kabutops", + "aerodactyl": "Aerodactyl", + "snorlax": "Snorlax", + "articuno": "Articuno", + "zapdos": "Zapdos", + "moltres": "Moltres", + "dratini": "Dratini", + "dragonair": "Dragonair", + "dragonite": "Dragonite", + "mewtwo": "Mewtwo", + "mew": "Mew", + "chikorita": "Chikorita", + "bayleef": "Bayleef", + "meganium": "Meganium", + "cyndaquil": "Cyndaquil", + "quilava": "Quilava", + "typhlosion": "Typhlosion", + "totodile": "Totodile", + "croconaw": "Croconaw", + "feraligatr": "Feraligatr", + "sentret": "Sentret", + "furret": "Furret", + "hoothoot": "Hoothoot", + "noctowl": "Noctowl", + "ledyba": "Ledyba", + "ledian": "Ledian", + "spinarak": "Spinarak", + "ariados": "Ariados", + "crobat": "Crobat", + "chinchou": "Chinchou", + "lanturn": "Lanturn", + "pichu": "Pichu", + "cleffa": "Cleffa", + "igglybuff": "Igglybuff", + "togepi": "Togepi", + "togetic": "Togetic", + "natu": "Natu", + "xatu": "Xatu", + "mareep": "Mareep", + "flaaffy": "Flaaffy", + "ampharos": "Ampharos", + "bellossom": "Bellossom", + "marill": "Marill", + "azumarill": "Azumarill", + "sudowoodo": "Sudowoodo", + "politoed": "Politoed", + "hoppip": "Hoppip", + "skiploom": "Skiploom", + "jumpluff": "Jumpluff", + "aipom": "Aipom", + "sunkern": "Sunkern", + "sunflora": "Sunflora", + "yanma": "Yanma", + "wooper": "Wooper", + "quagsire": "Quagsire", + "espeon": "Espeon", + "umbreon": "Umbreon", + "murkrow": "Murkrow", + "slowking": "Slowking", + "misdreavus": "Misdreavus", + "unown": "Unown", + "wobbuffet": "Wobbuffet", + "girafarig": "Girafarig", + "pineco": "Pineco", + "forretress": "Forretress", + "dunsparce": "Dunsparce", + "gligar": "Gligar", + "steelix": "Steelix", + "snubbull": "Snubbull", + "granbull": "Granbull", + "qwilfish": "Qwilfish", + "scizor": "Scizor", + "shuckle": "Shuckle", + "heracross": "Heracross", + "sneasel": "Sneasel", + "teddiursa": "Teddiursa", + "ursaring": "Ursaring", + "slugma": "Slugma", + "magcargo": "Magcargo", + "swinub": "Swinub", + "piloswine": "Piloswine", + "corsola": "Corsola", + "remoraid": "Remoraid", + "octillery": "Octillery", + "delibird": "Delibird", + "mantine": "Mantine", + "skarmory": "Skarmory", + "houndour": "Houndour", + "houndoom": "Houndoom", + "kingdra": "Kingdra", + "phanpy": "Phanpy", + "donphan": "Donphan", + "porygon2": "Porygon2", + "stantler": "Stantler", + "smeargle": "Smeargle", + "tyrogue": "Tyrogue", + "hitmontop": "Hitmontop", + "smoochum": "Smoochum", + "elekid": "Elekid", + "magby": "Magby", + "miltank": "Miltank", + "blissey": "Blissey", + "raikou": "Raikou", + "entei": "Entei", + "suicune": "Suicune", + "larvitar": "Larvitar", + "pupitar": "Pupitar", + "tyranitar": "Tyranitar", + "lugia": "Lugia", + "ho-oh": "Ho-Oh", + "celebi": "Celebi" }, "entry": { "bulbasaur": "A strange seed was planted on its back at birth. The plant sprouts and grows with this Pokémon.", @@ -507,261 +757,9 @@ "tyranitar": "Its body can't be harmed by any sort of attack, so it is very eager to make challenges against enemies.", "lugia": "It is said that it quietly spends its time deep at the bottom of the sea because its powers are too strong.", "ho-oh": "Legends claim this Pokémon flies the world's skies continuously on its magnificent seven-colored wings.", - "celebi": "This Pokémon wanders across time. Grass and trees flourish in the forests in which it has appeared." - }, - "sprite": { - "bulbasaur": "http://www.serebii.net/pokedex-sm/icon/001.png", - "ivysaur": "http://www.serebii.net/pokedex-sm/icon/002.png", - "venusaur": "http://www.serebii.net/pokedex-sm/icon/003.png", - "charmander": "http://www.serebii.net/pokedex-sm/icon/004.png", - "charmeleon": "http://www.serebii.net/pokedex-sm/icon/005.png", - "charizard": "http://www.serebii.net/pokedex-sm/icon/006.png", - "squirtle": "http://www.serebii.net/pokedex-sm/icon/007.png", - "wartortle": "http://www.serebii.net/pokedex-sm/icon/008.png", - "blastoise": "http://www.serebii.net/pokedex-sm/icon/009.png", - "caterpie": "http://www.serebii.net/pokedex-sm/icon/010.png", - "metapod": "http://www.serebii.net/pokedex-sm/icon/011.png", - "butterfree": "http://www.serebii.net/pokedex-sm/icon/012.png", - "weedle": "http://www.serebii.net/pokedex-sm/icon/013.png", - "kakuna": "http://www.serebii.net/pokedex-sm/icon/014.png", - "beedrill": "http://www.serebii.net/pokedex-sm/icon/015.png", - "pidgey": "http://www.serebii.net/pokedex-sm/icon/016.png", - "pidgeotto": "http://www.serebii.net/pokedex-sm/icon/017.png", - "pidgeot": "http://www.serebii.net/pokedex-sm/icon/018.png", - "rattata": "http://www.serebii.net/pokedex-sm/icon/019.png", - "raticate": "http://www.serebii.net/pokedex-sm/icon/020.png", - "spearow": "http://www.serebii.net/pokedex-sm/icon/021.png", - "fearow": "http://www.serebii.net/pokedex-sm/icon/022.png", - "ekans": "http://www.serebii.net/pokedex-sm/icon/023.png", - "arbok": "http://www.serebii.net/pokedex-sm/icon/024.png", - "pikachu": "http://www.serebii.net/pokedex-sm/icon/025.png", - "raichu": "http://www.serebii.net/pokedex-sm/icon/026.png", - "sandshrew": "http://www.serebii.net/pokedex-sm/icon/027.png", - "sandslash": "http://www.serebii.net/pokedex-sm/icon/028.png", - "nidoranf": "http://www.serebii.net/pokedex-sm/icon/029.png", - "nidorina": "http://www.serebii.net/pokedex-sm/icon/030.png", - "nidoqueen": "http://www.serebii.net/pokedex-sm/icon/031.png", - "nidoranm": "http://www.serebii.net/pokedex-sm/icon/032.png", - "nidorino": "http://www.serebii.net/pokedex-sm/icon/033.png", - "nidoking": "http://www.serebii.net/pokedex-sm/icon/034.png", - "clefairy": "http://www.serebii.net/pokedex-sm/icon/035.png", - "clefable": "http://www.serebii.net/pokedex-sm/icon/036.png", - "vulpix": "http://www.serebii.net/pokedex-sm/icon/037.png", - "ninetales": "http://www.serebii.net/pokedex-sm/icon/038.png", - "jigglypuff": "http://www.serebii.net/pokedex-sm/icon/039.png", - "wigglytuff": "http://www.serebii.net/pokedex-sm/icon/040.png", - "zubat": "http://www.serebii.net/pokedex-sm/icon/041.png", - "golbat": "http://www.serebii.net/pokedex-sm/icon/042.png", - "oddish": "http://www.serebii.net/pokedex-sm/icon/043.png", - "gloom": "http://www.serebii.net/pokedex-sm/icon/044.png", - "vileplume": "http://www.serebii.net/pokedex-sm/icon/045.png", - "paras": "http://www.serebii.net/pokedex-sm/icon/046.png", - "parasect": "http://www.serebii.net/pokedex-sm/icon/047.png", - "venonat": "http://www.serebii.net/pokedex-sm/icon/048.png", - "venomoth": "http://www.serebii.net/pokedex-sm/icon/049.png", - "diglett": "http://www.serebii.net/pokedex-sm/icon/050.png", - "dugtrio": "http://www.serebii.net/pokedex-sm/icon/051.png", - "meowth": "http://www.serebii.net/pokedex-sm/icon/052.png", - "persian": "http://www.serebii.net/pokedex-sm/icon/053.png", - "psyduck": "http://www.serebii.net/pokedex-sm/icon/054.png", - "golduck": "http://www.serebii.net/pokedex-sm/icon/055.png", - "mankey": "http://www.serebii.net/pokedex-sm/icon/056.png", - "primeape": "http://www.serebii.net/pokedex-sm/icon/057.png", - "growlithe": "http://www.serebii.net/pokedex-sm/icon/058.png", - "arcanine": "http://www.serebii.net/pokedex-sm/icon/059.png", - "poliwag": "http://www.serebii.net/pokedex-sm/icon/060.png", - "poliwhirl": "http://www.serebii.net/pokedex-sm/icon/061.png", - "poliwrath": "http://www.serebii.net/pokedex-sm/icon/062.png", - "abra": "http://www.serebii.net/pokedex-sm/icon/063.png", - "kadabra": "http://www.serebii.net/pokedex-sm/icon/064.png", - "alakazam": "http://www.serebii.net/pokedex-sm/icon/065.png", - "machop": "http://www.serebii.net/pokedex-sm/icon/066.png", - "machoke": "http://www.serebii.net/pokedex-sm/icon/067.png", - "machamp": "http://www.serebii.net/pokedex-sm/icon/068.png", - "bellsprout": "http://www.serebii.net/pokedex-sm/icon/069.png", - "weepinbell": "http://www.serebii.net/pokedex-sm/icon/070.png", - "victreebel": "http://www.serebii.net/pokedex-sm/icon/071.png", - "tentacool": "http://www.serebii.net/pokedex-sm/icon/072.png", - "tentacruel": "http://www.serebii.net/pokedex-sm/icon/073.png", - "geodude": "http://www.serebii.net/pokedex-sm/icon/074.png", - "graveler": "http://www.serebii.net/pokedex-sm/icon/075.png", - "golem": "http://www.serebii.net/pokedex-sm/icon/076.png", - "ponyta": "http://www.serebii.net/pokedex-sm/icon/077.png", - "rapidash": "http://www.serebii.net/pokedex-sm/icon/078.png", - "slowpoke": "http://www.serebii.net/pokedex-sm/icon/079.png", - "slowbro": "http://www.serebii.net/pokedex-sm/icon/080.png", - "magnemite": "http://www.serebii.net/pokedex-sm/icon/081.png", - "magneton": "http://www.serebii.net/pokedex-sm/icon/082.png", - "farfetch'd": "http://www.serebii.net/pokedex-sm/icon/083.png", - "doduo": "http://www.serebii.net/pokedex-sm/icon/084.png", - "dodrio": "http://www.serebii.net/pokedex-sm/icon/085.png", - "seel": "http://www.serebii.net/pokedex-sm/icon/086.png", - "dewgong": "http://www.serebii.net/pokedex-sm/icon/087.png", - "grimer": "http://www.serebii.net/pokedex-sm/icon/088.png", - "muk": "http://www.serebii.net/pokedex-sm/icon/089.png", - "shellder": "http://www.serebii.net/pokedex-sm/icon/090.png", - "cloyster": "http://www.serebii.net/pokedex-sm/icon/091.png", - "gastly": "http://www.serebii.net/pokedex-sm/icon/092.png", - "haunter": "http://www.serebii.net/pokedex-sm/icon/093.png", - "gengar": "http://www.serebii.net/pokedex-sm/icon/094.png", - "onix": "http://www.serebii.net/pokedex-sm/icon/095.png", - "drowzee": "http://www.serebii.net/pokedex-sm/icon/096.png", - "hypno": "http://www.serebii.net/pokedex-sm/icon/097.png", - "krabby": "http://www.serebii.net/pokedex-sm/icon/098.png", - "kingler": "http://www.serebii.net/pokedex-sm/icon/099.png", - "voltorb": "http://www.serebii.net/pokedex-sm/icon/100.png", - "electrode": "http://www.serebii.net/pokedex-sm/icon/101.png", - "exeggcute": "http://www.serebii.net/pokedex-sm/icon/102.png", - "exeggutor": "http://www.serebii.net/pokedex-sm/icon/103.png", - "cubone": "http://www.serebii.net/pokedex-sm/icon/104.png", - "marowak": "http://www.serebii.net/pokedex-sm/icon/105.png", - "hitmonlee": "http://www.serebii.net/pokedex-sm/icon/106.png", - "hitmonchan": "http://www.serebii.net/pokedex-sm/icon/107.png", - "lickitung": "http://www.serebii.net/pokedex-sm/icon/108.png", - "koffing": "http://www.serebii.net/pokedex-sm/icon/109.png", - "weezing": "http://www.serebii.net/pokedex-sm/icon/110.png", - "rhyhorn": "http://www.serebii.net/pokedex-sm/icon/111.png", - "rhydon": "http://www.serebii.net/pokedex-sm/icon/112.png", - "chansey": "http://www.serebii.net/pokedex-sm/icon/113.png", - "tangela": "http://www.serebii.net/pokedex-sm/icon/114.png", - "kangaskhan": "http://www.serebii.net/pokedex-sm/icon/115.png", - "horsea": "http://www.serebii.net/pokedex-sm/icon/116.png", - "seadra": "http://www.serebii.net/pokedex-sm/icon/117.png", - "goldeen": "http://www.serebii.net/pokedex-sm/icon/118.png", - "seaking": "http://www.serebii.net/pokedex-sm/icon/119.png", - "staryu": "http://www.serebii.net/pokedex-sm/icon/120.png", - "starmie": "http://www.serebii.net/pokedex-sm/icon/121.png", - "mr. mime": "http://www.serebii.net/pokedex-sm/icon/122.png", - "scyther": "http://www.serebii.net/pokedex-sm/icon/123.png", - "jynx": "http://www.serebii.net/pokedex-sm/icon/124.png", - "electabuzz": "http://www.serebii.net/pokedex-sm/icon/125.png", - "magmar": "http://www.serebii.net/pokedex-sm/icon/126.png", - "pinsir": "http://www.serebii.net/pokedex-sm/icon/127.png", - "tauros": "http://www.serebii.net/pokedex-sm/icon/128.png", - "magikarp": "http://www.serebii.net/pokedex-sm/icon/129.png", - "gyarados": "http://www.serebii.net/pokedex-sm/icon/130.png", - "lapras": "http://www.serebii.net/pokedex-sm/icon/131.png", - "ditto": "http://www.serebii.net/pokedex-sm/icon/132.png", - "eevee": "http://www.serebii.net/pokedex-sm/icon/133.png", - "vaporeon": "http://www.serebii.net/pokedex-sm/icon/134.png", - "jolteon": "http://www.serebii.net/pokedex-sm/icon/135.png", - "flareon": "http://www.serebii.net/pokedex-sm/icon/136.png", - "porygon": "http://www.serebii.net/pokedex-sm/icon/137.png", - "omanyte": "http://www.serebii.net/pokedex-sm/icon/138.png", - "omastar": "http://www.serebii.net/pokedex-sm/icon/139.png", - "kabuto": "http://www.serebii.net/pokedex-sm/icon/140.png", - "kabutops": "http://www.serebii.net/pokedex-sm/icon/141.png", - "aerodactyl": "http://www.serebii.net/pokedex-sm/icon/142.png", - "snorlax": "http://www.serebii.net/pokedex-sm/icon/143.png", - "articuno": "http://www.serebii.net/pokedex-sm/icon/144.png", - "zapdos": "http://www.serebii.net/pokedex-sm/icon/145.png", - "moltres": "http://www.serebii.net/pokedex-sm/icon/146.png", - "dratini": "http://www.serebii.net/pokedex-sm/icon/147.png", - "dragonair": "http://www.serebii.net/pokedex-sm/icon/148.png", - "dragonite": "http://www.serebii.net/pokedex-sm/icon/149.png", - "mewtwo": "http://www.serebii.net/pokedex-sm/icon/150.png", - "mew": "http://www.serebii.net/pokedex-sm/icon/151.png", - "missingno.": "http://cdn.bulbagarden.net/upload/1/1f/AniMS_Missingno_I.png", - "chikorita": "http://www.serebii.net/pokedex-sm/icon/152.png", - "bayleef": "http://www.serebii.net/pokedex-sm/icon/153.png", - "meganium": "http://www.serebii.net/pokedex-sm/icon/154.png", - "cyndaquil": "http://www.serebii.net/pokedex-sm/icon/155.png", - "quilava": "http://www.serebii.net/pokedex-sm/icon/156.png", - "typhlosion": "http://www.serebii.net/pokedex-sm/icon/157.png", - "totodile": "http://www.serebii.net/pokedex-sm/icon/158.png", - "croconaw": "http://www.serebii.net/pokedex-sm/icon/159.png", - "feraligatr": "http://www.serebii.net/pokedex-sm/icon/160.png", - "sentret": "http://www.serebii.net/pokedex-sm/icon/161.png", - "furret": "http://www.serebii.net/pokedex-sm/icon/162.png", - "hoothoot": "http://www.serebii.net/pokedex-sm/icon/163.png", - "noctowl": "http://www.serebii.net/pokedex-sm/icon/164.png", - "ledyba": "http://www.serebii.net/pokedex-sm/icon/165.png", - "ledian": "http://www.serebii.net/pokedex-sm/icon/166.png", - "spinarak": "http://www.serebii.net/pokedex-sm/icon/167.png", - "ariados": "http://www.serebii.net/pokedex-sm/icon/168.png", - "crobat": "http://www.serebii.net/pokedex-sm/icon/169.png", - "chinchou": "http://www.serebii.net/pokedex-sm/icon/170.png", - "lanturn": "http://www.serebii.net/pokedex-sm/icon/171.png", - "pichu": "http://www.serebii.net/pokedex-sm/icon/172.png", - "cleffa": "http://www.serebii.net/pokedex-sm/icon/173.png", - "igglybuff": "http://www.serebii.net/pokedex-sm/icon/174.png", - "togepi": "http://www.serebii.net/pokedex-sm/icon/175.png", - "togetic": "http://www.serebii.net/pokedex-sm/icon/176.png", - "natu": "http://www.serebii.net/pokedex-sm/icon/177.png", - "xatu": "http://www.serebii.net/pokedex-sm/icon/178.png", - "mareep": "http://www.serebii.net/pokedex-sm/icon/179.png", - "flaaffy": "http://www.serebii.net/pokedex-sm/icon/180.png", - "ampharos": "http://www.serebii.net/pokedex-sm/icon/181.png", - "bellossom": "http://www.serebii.net/pokedex-sm/icon/182.png", - "marill": "http://www.serebii.net/pokedex-sm/icon/183.png", - "azumarill": "http://www.serebii.net/pokedex-sm/icon/184.png", - "sudowoodo": "http://www.serebii.net/pokedex-sm/icon/185.png", - "politoed": "http://www.serebii.net/pokedex-sm/icon/186.png", - "hoppip": "http://www.serebii.net/pokedex-sm/icon/187.png", - "skiploom": "http://www.serebii.net/pokedex-sm/icon/188.png", - "jumpluff": "http://www.serebii.net/pokedex-sm/icon/189.png", - "aipom": "http://www.serebii.net/pokedex-sm/icon/190.png", - "sunkern": "http://www.serebii.net/pokedex-sm/icon/191.png", - "sunflora": "http://www.serebii.net/pokedex-sm/icon/192.png", - "yanma": "http://www.serebii.net/pokedex-sm/icon/193.png", - "wooper": "http://www.serebii.net/pokedex-sm/icon/194.png", - "quagsire": "http://www.serebii.net/pokedex-sm/icon/195.png", - "espeon": "http://www.serebii.net/pokedex-sm/icon/196.png", - "umbreon": "http://www.serebii.net/pokedex-sm/icon/197.png", - "murkrow": "http://www.serebii.net/pokedex-sm/icon/198.png", - "slowking": "http://www.serebii.net/pokedex-sm/icon/199.png", - "misdreavus": "http://www.serebii.net/pokedex-sm/icon/200.png", - "unown": "http://www.serebii.net/pokedex-sm/icon/201.png", - "wobbuffet": "http://www.serebii.net/pokedex-sm/icon/202.png", - "girafarig": "http://www.serebii.net/pokedex-sm/icon/203.png", - "pineco": "http://www.serebii.net/pokedex-sm/icon/204.png", - "forretress": "http://www.serebii.net/pokedex-sm/icon/205.png", - "dunsparce": "http://www.serebii.net/pokedex-sm/icon/206.png", - "gligar": "http://www.serebii.net/pokedex-sm/icon/207.png", - "steelix": "http://www.serebii.net/pokedex-sm/icon/208.png", - "snubbull": "http://www.serebii.net/pokedex-sm/icon/209.png", - "granbull": "http://www.serebii.net/pokedex-sm/icon/210.png", - "qwilfish": "http://www.serebii.net/pokedex-sm/icon/211.png", - "scizor": "http://www.serebii.net/pokedex-sm/icon/212.png", - "shuckle": "http://www.serebii.net/pokedex-sm/icon/213.png", - "heracross": "http://www.serebii.net/pokedex-sm/icon/214.png", - "sneasel": "http://www.serebii.net/pokedex-sm/icon/215.png", - "teddiursa": "http://www.serebii.net/pokedex-sm/icon/216.png", - "ursaring": "http://www.serebii.net/pokedex-sm/icon/217.png", - "slugma": "http://www.serebii.net/pokedex-sm/icon/218.png", - "magcargo": "http://www.serebii.net/pokedex-sm/icon/219.png", - "swinub": "http://www.serebii.net/pokedex-sm/icon/220.png", - "piloswine": "http://www.serebii.net/pokedex-sm/icon/221.png", - "corsola": "http://www.serebii.net/pokedex-sm/icon/222.png", - "remoraid": "http://www.serebii.net/pokedex-sm/icon/223.png", - "octillery": "http://www.serebii.net/pokedex-sm/icon/224.png", - "delibird": "http://www.serebii.net/pokedex-sm/icon/225.png", - "mantine": "http://www.serebii.net/pokedex-sm/icon/226.png", - "skarmory": "http://www.serebii.net/pokedex-sm/icon/227.png", - "houndour": "http://www.serebii.net/pokedex-sm/icon/228.png", - "houndoom": "http://www.serebii.net/pokedex-sm/icon/229.png", - "kingdra": "http://www.serebii.net/pokedex-sm/icon/230.png", - "phanpy": "http://www.serebii.net/pokedex-sm/icon/231.png", - "donphan": "http://www.serebii.net/pokedex-sm/icon/232.png", - "porygon2": "http://www.serebii.net/pokedex-sm/icon/233.png", - "stantler": "http://www.serebii.net/pokedex-sm/icon/234.png", - "smeargle": "http://www.serebii.net/pokedex-sm/icon/235.png", - "tyrogue": "http://www.serebii.net/pokedex-sm/icon/236.png", - "hitmontop": "http://www.serebii.net/pokedex-sm/icon/237.png", - "smoochum": "http://www.serebii.net/pokedex-sm/icon/238.png", - "elekid": "http://www.serebii.net/pokedex-sm/icon/239.png", - "magby": "http://www.serebii.net/pokedex-sm/icon/240.png", - "miltank": "http://www.serebii.net/pokedex-sm/icon/241.png", - "blissey": "http://www.serebii.net/pokedex-sm/icon/242.png", - "raikou": "http://www.serebii.net/pokedex-sm/icon/243.png", - "entei": "http://www.serebii.net/pokedex-sm/icon/244.png", - "suicune": "http://www.serebii.net/pokedex-sm/icon/245.png", - "larvitar": "http://www.serebii.net/pokedex-sm/icon/246.png", - "pupitar": "http://www.serebii.net/pokedex-sm/icon/247.png", - "tyranitar": "http://www.serebii.net/pokedex-sm/icon/248.png", - "lugia": "http://www.serebii.net/pokedex-sm/icon/249.png", - "ho-oh": "http://www.serebii.net/pokedex-sm/icon/250.png", - "celebi": "http://www.serebii.net/pokedex-sm/icon/251.png" + "celebi": "This Pokémon wanders across time. Grass and trees flourish in the forests in which it has appeared.", + "treeko": "Treecko has small hooks on the bottom of its feet that enable it to scale vertical walls. This Pokémon attacks by slamming foes with its thick tail.", + "grovyle": "The leaves growing out of Grovyle's body are convenient for camouflaging it from enemies in the forest. This Pokémon is a master at climbing trees in jungles." }, "species": { "bulbasaur": "Seed Pokémon", @@ -1017,260 +1015,6 @@ "ho-oh": "Rainbow Pokémon", "celebi": "Time Travel Pokémon" }, - "picture": { - "bulbasaur": "http://cdn.bulbagarden.net/upload/thumb/2/21/001Bulbasaur.png/250px-001Bulbasaur.png", - "ivysaur": "http://cdn.bulbagarden.net/upload/thumb/7/73/002Ivysaur.png/250px-002Ivysaur.png", - "venusaur": "http://cdn.bulbagarden.net/upload/thumb/a/ae/003Venusaur.png/250px-003Venusaur.png", - "charmander": "http://cdn.bulbagarden.net/upload/thumb/7/73/004Charmander.png/250px-004Charmander.png", - "charmeleon": "http://cdn.bulbagarden.net/upload/thumb/4/4a/005Charmeleon.png/250px-005Charmeleon.png", - "charizard": "http://cdn.bulbagarden.net/upload/thumb/7/7e/006Charizard.png/250px-006Charizard.png", - "squirtle": "http://cdn.bulbagarden.net/upload/thumb/3/39/007Squirtle.png/250px-007Squirtle.png", - "wartortle": "http://cdn.bulbagarden.net/upload/thumb/0/0c/008Wartortle.png/250px-008Wartortle.png", - "blastoise": "http://cdn.bulbagarden.net/upload/thumb/0/02/009Blastoise.png/250px-009Blastoise.png", - "caterpie": "http://cdn.bulbagarden.net/upload/thumb/5/5d/010Caterpie.png/250px-010Caterpie.png", - "metapod": "http://cdn.bulbagarden.net/upload/thumb/c/cd/011Metapod.png/250px-011Metapod.png", - "butterfree": "http://cdn.bulbagarden.net/upload/thumb/d/d1/012Butterfree.png/250px-012Butterfree.png", - "weedle": "http://cdn.bulbagarden.net/upload/thumb/d/df/013Weedle.png/250px-013Weedle.png", - "kakuna": "http://cdn.bulbagarden.net/upload/thumb/f/f0/014Kakuna.png/250px-014Kakuna.png", - "beedrill": "http://cdn.bulbagarden.net/upload/thumb/6/61/015Beedrill.png/250px-015Beedrill.png", - "pidgey": "http://cdn.bulbagarden.net/upload/thumb/5/55/016Pidgey.png/250px-016Pidgey.png", - "pidgeotto": "http://cdn.bulbagarden.net/upload/thumb/7/7a/017Pidgeotto.png/250px-017Pidgeotto.png", - "pidgeot": "http://cdn.bulbagarden.net/upload/thumb/5/57/018Pidgeot.png/250px-018Pidgeot.png", - "rattata": "http://cdn.bulbagarden.net/upload/thumb/4/46/019Rattata.png/250px-019Rattata.png", - "raticate": "http://cdn.bulbagarden.net/upload/thumb/f/f4/020Raticate.png/250px-020Raticate.png", - "spearow": "http://cdn.bulbagarden.net/upload/thumb/8/8b/021Spearow.png/250px-021Spearow.png", - "fearow": "http://cdn.bulbagarden.net/upload/thumb/a/a0/022Fearow.png/250px-022Fearow.png", - "ekans": "http://cdn.bulbagarden.net/upload/thumb/f/fa/023Ekans.png/250px-023Ekans.png", - "arbok": "http://cdn.bulbagarden.net/upload/thumb/c/cd/024Arbok.png/250px-024Arbok.png", - "pikachu": "http://cdn.bulbagarden.net/upload/thumb/0/0d/025Pikachu.png/250px-025Pikachu.png", - "raichu": "http://cdn.bulbagarden.net/upload/thumb/8/88/026Raichu.png/250px-026Raichu.png", - "sandshrew": "http://cdn.bulbagarden.net/upload/thumb/9/9e/027Sandshrew.png/250px-027Sandshrew.png", - "sandslash": "http://cdn.bulbagarden.net/upload/thumb/0/0b/028Sandslash.png/250px-028Sandslash.png", - "nidoranf": "http://cdn.bulbagarden.net/upload/thumb/8/81/029Nidoran.png/250px-029Nidoran.png", - "nidorina": "http://cdn.bulbagarden.net/upload/thumb/c/cd/030Nidorina.png/250px-030Nidorina.png", - "nidoqueen": "http://cdn.bulbagarden.net/upload/thumb/b/bf/031Nidoqueen.png/250px-031Nidoqueen.png", - "nidoranm": "http://cdn.bulbagarden.net/upload/thumb/4/4a/032Nidoran.png/250px-032Nidoran.png", - "nidorino": "http://cdn.bulbagarden.net/upload/thumb/9/9f/033Nidorino.png/250px-033Nidorino.png", - "nidoking": "http://cdn.bulbagarden.net/upload/thumb/c/c6/034Nidoking.png/250px-034Nidoking.png", - "clefairy": "http://cdn.bulbagarden.net/upload/thumb/f/f4/035Clefairy.png/250px-035Clefairy.png", - "clefable": "http://cdn.bulbagarden.net/upload/thumb/a/a9/036Clefable.png/250px-036Clefable.png", - "vulpix": "http://cdn.bulbagarden.net/upload/thumb/6/60/037Vulpix.png/250px-037Vulpix.png", - "ninetales": "http://cdn.bulbagarden.net/upload/thumb/0/05/038Ninetales.png/250px-038Ninetales.png", - "jigglypuff": "http://cdn.bulbagarden.net/upload/thumb/3/3e/039Jigglypuff.png/250px-039Jigglypuff.png", - "wigglytuff": "http://cdn.bulbagarden.net/upload/thumb/9/92/040Wigglytuff.png/250px-040Wigglytuff.png", - "zubat": "http://cdn.bulbagarden.net/upload/thumb/d/da/041Zubat.png/250px-041Zubat.png", - "golbat": "http://cdn.bulbagarden.net/upload/thumb/0/0c/042Golbat.png/250px-042Golbat.png", - "oddish": "http://cdn.bulbagarden.net/upload/thumb/4/43/043Oddish.png/250px-043Oddish.png", - "gloom": "http://cdn.bulbagarden.net/upload/thumb/2/2a/044Gloom.png/250px-044Gloom.png", - "vileplume": "http://cdn.bulbagarden.net/upload/thumb/6/6a/045Vileplume.png/250px-045Vileplume.png", - "paras": "http://cdn.bulbagarden.net/upload/thumb/d/d4/046Paras.png/250px-046Paras.png", - "parasect": "http://cdn.bulbagarden.net/upload/thumb/8/80/047Parasect.png/250px-047Parasect.png", - "venonat": "http://cdn.bulbagarden.net/upload/thumb/a/ad/048Venonat.png/250px-048Venonat.png", - "venomoth": "http://cdn.bulbagarden.net/upload/thumb/d/d3/049Venomoth.png/250px-049Venomoth.png", - "diglett": "http://cdn.bulbagarden.net/upload/thumb/3/31/050Diglett.png/250px-050Diglett.png", - "dugtrio": "http://cdn.bulbagarden.net/upload/thumb/e/e5/051Dugtrio.png/250px-051Dugtrio.png", - "meowth": "http://cdn.bulbagarden.net/upload/thumb/d/d6/052Meowth.png/250px-052Meowth.png", - "persian": "http://cdn.bulbagarden.net/upload/thumb/1/13/053Persian.png/250px-053Persian.png", - "psyduck": "http://cdn.bulbagarden.net/upload/thumb/5/53/054Psyduck.png/250px-054Psyduck.png", - "golduck": "http://cdn.bulbagarden.net/upload/thumb/f/fe/055Golduck.png/250px-055Golduck.png", - "mankey": "http://cdn.bulbagarden.net/upload/thumb/4/41/056Mankey.png/250px-056Mankey.png", - "primeape": "http://cdn.bulbagarden.net/upload/thumb/9/9a/057Primeape.png/250px-057Primeape.png", - "growlithe": "http://cdn.bulbagarden.net/upload/thumb/3/3d/058Growlithe.png/250px-058Growlithe.png", - "arcanine": "http://cdn.bulbagarden.net/upload/thumb/b/b8/059Arcanine.png/250px-059Arcanine.png", - "poliwag": "http://cdn.bulbagarden.net/upload/thumb/4/49/060Poliwag.png/250px-060Poliwag.png", - "poliwhirl": "http://cdn.bulbagarden.net/upload/thumb/a/a9/061Poliwhirl.png/250px-061Poliwhirl.png", - "poliwrath": "http://cdn.bulbagarden.net/upload/thumb/2/2d/062Poliwrath.png/250px-062Poliwrath.png", - "abra": "http://cdn.bulbagarden.net/upload/thumb/6/62/063Abra.png/250px-063Abra.png", - "kadabra": "http://cdn.bulbagarden.net/upload/thumb/9/97/064Kadabra.png/250px-064Kadabra.png", - "alakazam": "http://cdn.bulbagarden.net/upload/thumb/c/cc/065Alakazam.png/250px-065Alakazam.png", - "machop": "http://cdn.bulbagarden.net/upload/thumb/8/85/066Machop.png/250px-066Machop.png", - "machoke": "http://cdn.bulbagarden.net/upload/thumb/8/8e/067Machoke.png/250px-067Machoke.png", - "machamp": "http://cdn.bulbagarden.net/upload/thumb/8/8f/068Machamp.png/250px-068Machamp.png", - "bellsprout": "http://cdn.bulbagarden.net/upload/thumb/a/a2/069Bellsprout.png/250px-069Bellsprout.png", - "weepinbell": "http://cdn.bulbagarden.net/upload/thumb/9/9f/070Weepinbell.png/250px-070Weepinbell.png", - "victreebel": "http://cdn.bulbagarden.net/upload/thumb/b/be/071Victreebel.png/250px-071Victreebel.png", - "tentacool": "http://cdn.bulbagarden.net/upload/thumb/4/4e/072Tentacool.png/250px-072Tentacool.png", - "tentacruel": "http://cdn.bulbagarden.net/upload/thumb/f/f6/073Tentacruel.png/250px-073Tentacruel.png", - "geodude": "http://cdn.bulbagarden.net/upload/thumb/9/98/074Geodude.png/250px-074Geodude.png", - "graveler": "http://cdn.bulbagarden.net/upload/thumb/7/75/075Graveler.png/250px-075Graveler.png", - "golem": "http://cdn.bulbagarden.net/upload/thumb/f/f2/076Golem.png/250px-076Golem.png", - "ponyta": "http://cdn.bulbagarden.net/upload/thumb/3/3b/077Ponyta.png/250px-077Ponyta.png", - "rapidash": "http://cdn.bulbagarden.net/upload/thumb/3/3f/078Rapidash.png/250px-078Rapidash.png", - "slowpoke": "http://cdn.bulbagarden.net/upload/thumb/7/70/079Slowpoke.png/250px-079Slowpoke.png", - "slowbro": "http://cdn.bulbagarden.net/upload/thumb/8/80/080Slowbro.png/250px-080Slowbro.png", - "magnemite": "http://cdn.bulbagarden.net/upload/thumb/6/6c/081Magnemite.png/250px-081Magnemite.png", - "magneton": "http://cdn.bulbagarden.net/upload/thumb/7/72/082Magneton.png/250px-082Magneton.png", - "farfetch'd": "http://cdn.bulbagarden.net/upload/thumb/f/f8/083Farfetch%27d.png/250px-083Farfetch%27d.png", - "doduo": "http://cdn.bulbagarden.net/upload/thumb/5/54/084Doduo.png/250px-084Doduo.png", - "dodrio": "http://cdn.bulbagarden.net/upload/thumb/9/93/085Dodrio.png/250px-085Dodrio.png", - "seel": "http://cdn.bulbagarden.net/upload/thumb/1/1f/086Seel.png/250px-086Seel.png", - "dewgong": "http://cdn.bulbagarden.net/upload/thumb/c/c7/087Dewgong.png/250px-087Dewgong.png", - "grimer": "http://cdn.bulbagarden.net/upload/thumb/a/a0/088Grimer.png/250px-088Grimer.png", - "muk": "http://cdn.bulbagarden.net/upload/thumb/7/7c/089Muk.png/250px-089Muk.png", - "shellder": "http://cdn.bulbagarden.net/upload/thumb/4/40/090Shellder.png/250px-090Shellder.png", - "cloyster": "http://cdn.bulbagarden.net/upload/thumb/1/1d/091Cloyster.png/250px-091Cloyster.png", - "gastly": "http://cdn.bulbagarden.net/upload/thumb/c/ca/092Gastly.png/250px-092Gastly.png", - "haunter": "http://cdn.bulbagarden.net/upload/thumb/6/62/093Haunter.png/250px-093Haunter.png", - "gengar": "http://cdn.bulbagarden.net/upload/thumb/c/c6/094Gengar.png/250px-094Gengar.png", - "onix": "http://cdn.bulbagarden.net/upload/thumb/9/9a/095Onix.png/250px-095Onix.png", - "drowzee": "http://cdn.bulbagarden.net/upload/thumb/3/3e/096Drowzee.png/250px-096Drowzee.png", - "hypno": "http://cdn.bulbagarden.net/upload/thumb/0/0a/097Hypno.png/250px-097Hypno.png", - "krabby": "http://cdn.bulbagarden.net/upload/thumb/a/a7/098Krabby.png/250px-098Krabby.png", - "kingler": "http://cdn.bulbagarden.net/upload/thumb/7/71/099Kingler.png/250px-099Kingler.png", - "voltorb": "http://cdn.bulbagarden.net/upload/thumb/d/da/100Voltorb.png/250px-100Voltorb.png", - "electrode": "http://cdn.bulbagarden.net/upload/thumb/8/84/101Electrode.png/250px-101Electrode.png", - "exeggcute": "http://cdn.bulbagarden.net/upload/thumb/a/af/102Exeggcute.png/250px-102Exeggcute.png", - "exeggutor": "http://cdn.bulbagarden.net/upload/thumb/2/24/103Exeggutor.png/250px-103Exeggutor.png", - "cubone": "http://cdn.bulbagarden.net/upload/thumb/2/2a/104Cubone.png/250px-104Cubone.png", - "marowak": "http://cdn.bulbagarden.net/upload/thumb/9/98/105Marowak.png/250px-105Marowak.png", - "hitmonlee": "http://cdn.bulbagarden.net/upload/thumb/3/32/106Hitmonlee.png/250px-106Hitmonlee.png", - "hitmonchan": "http://cdn.bulbagarden.net/upload/a/a3/107Hitmonchan.png", - "lickitung": "http://cdn.bulbagarden.net/upload/thumb/0/00/108Lickitung.png/250px-108Lickitung.png", - "koffing": "http://cdn.bulbagarden.net/upload/thumb/1/17/109Koffing.png/250px-109Koffing.png", - "weezing": "http://cdn.bulbagarden.net/upload/thumb/4/42/110Weezing.png/250px-110Weezing.png", - "rhyhorn": "http://cdn.bulbagarden.net/upload/thumb/9/9b/111Rhyhorn.png/250px-111Rhyhorn.png", - "rhydon": "http://cdn.bulbagarden.net/upload/thumb/4/47/112Rhydon.png/250px-112Rhydon.png", - "chansey": "http://cdn.bulbagarden.net/upload/thumb/c/cd/113Chansey.png/250px-113Chansey.png", - "tangela": "http://cdn.bulbagarden.net/upload/thumb/3/3e/114Tangela.png/250px-114Tangela.png", - "kangaskhan": "http://cdn.bulbagarden.net/upload/thumb/4/4e/115Kangaskhan.png/250px-115Kangaskhan.png", - "horsea": "http://cdn.bulbagarden.net/upload/thumb/5/5a/116Horsea.png/250px-116Horsea.png", - "seadra": "http://cdn.bulbagarden.net/upload/thumb/2/26/117Seadra.png/250px-117Seadra.png", - "goldeen": "http://cdn.bulbagarden.net/upload/thumb/7/7b/118Goldeen.png/250px-118Goldeen.png", - "seaking": "http://cdn.bulbagarden.net/upload/thumb/6/6a/119Seaking.png/250px-119Seaking.png", - "staryu": "http://cdn.bulbagarden.net/upload/thumb/4/4f/120Staryu.png/250px-120Staryu.png", - "starmie": "http://cdn.bulbagarden.net/upload/thumb/c/cd/121Starmie.png/250px-121Starmie.png", - "mr. mime": "http://cdn.bulbagarden.net/upload/thumb/e/ec/122Mr._Mime.png/250px-122Mr._Mime.png", - "scyther": "http://cdn.bulbagarden.net/upload/thumb/b/ba/123Scyther.png/250px-123Scyther.png", - "jynx": "http://cdn.bulbagarden.net/upload/thumb/7/7c/124Jynx.png/250px-124Jynx.png", - "electabuzz": "http://cdn.bulbagarden.net/upload/thumb/d/de/125Electabuzz.png/250px-125Electabuzz.png", - "magmar": "http://cdn.bulbagarden.net/upload/thumb/8/8c/126Magmar.png/250px-126Magmar.png", - "pinsir": "http://cdn.bulbagarden.net/upload/thumb/7/71/127Pinsir.png/250px-127Pinsir.png", - "tauros": "http://cdn.bulbagarden.net/upload/thumb/b/b8/128Tauros.png/250px-128Tauros.png", - "magikarp": "http://cdn.bulbagarden.net/upload/thumb/0/02/129Magikarp.png/250px-129Magikarp.png", - "gyarados": "http://cdn.bulbagarden.net/upload/thumb/4/41/130Gyarados.png/250px-130Gyarados.png", - "lapras": "http://cdn.bulbagarden.net/upload/thumb/a/ab/131Lapras.png/250px-131Lapras.png", - "ditto": "http://cdn.bulbagarden.net/upload/thumb/3/36/132Ditto.png/250px-132Ditto.png", - "eevee": "http://cdn.bulbagarden.net/upload/thumb/e/e2/133Eevee.png/250px-133Eevee.png", - "vaporeon": "http://cdn.bulbagarden.net/upload/thumb/f/fd/134Vaporeon.png/250px-134Vaporeon.png", - "jolteon": "http://cdn.bulbagarden.net/upload/thumb/b/bb/135Jolteon.png/250px-135Jolteon.png", - "flareon": "http://cdn.bulbagarden.net/upload/thumb/d/dd/136Flareon.png/250px-136Flareon.png", - "porygon": "http://cdn.bulbagarden.net/upload/thumb/6/6b/137Porygon.png/250px-137Porygon.png", - "omanyte": "http://cdn.bulbagarden.net/upload/thumb/7/79/138Omanyte.png/250px-138Omanyte.png", - "omastar": "http://cdn.bulbagarden.net/upload/thumb/4/43/139Omastar.png/250px-139Omastar.png", - "kabuto": "http://cdn.bulbagarden.net/upload/thumb/f/f9/140Kabuto.png/250px-140Kabuto.png", - "kabutops": "http://cdn.bulbagarden.net/upload/thumb/2/29/141Kabutops.png/250px-141Kabutops.png", - "aerodactyl": "http://cdn.bulbagarden.net/upload/thumb/e/e8/142Aerodactyl.png/250px-142Aerodactyl.png", - "snorlax": "http://cdn.bulbagarden.net/upload/thumb/f/fb/143Snorlax.png/250px-143Snorlax.png", - "articuno": "http://cdn.bulbagarden.net/upload/thumb/4/4e/144Articuno.png/250px-144Articuno.png", - "zapdos": "http://cdn.bulbagarden.net/upload/thumb/e/e3/145Zapdos.png/250px-145Zapdos.png", - "moltres": "http://cdn.bulbagarden.net/upload/thumb/1/1b/146Moltres.png/250px-146Moltres.png", - "dratini": "http://cdn.bulbagarden.net/upload/thumb/c/cc/147Dratini.png/250px-147Dratini.png", - "dragonair": "http://cdn.bulbagarden.net/upload/thumb/9/93/148Dragonair.png/250px-148Dragonair.png", - "dragonite": "http://cdn.bulbagarden.net/upload/thumb/8/8b/149Dragonite.png/250px-149Dragonite.png", - "mewtwo": "http://cdn.bulbagarden.net/upload/thumb/7/78/150Mewtwo.png/250px-150Mewtwo.png", - "mew": "http://cdn.bulbagarden.net/upload/thumb/b/b1/151Mew.png/250px-151Mew.png", - "missingno.": "http://cdn.bulbagarden.net/upload/9/98/Missingno_RB.png", - "chikorita": "http://cdn.bulbagarden.net/upload/thumb/b/bf/152Chikorita.png/250px-152Chikorita.png", - "bayleef": "http://cdn.bulbagarden.net/upload/thumb/c/ca/153Bayleef.png/250px-153Bayleef.png", - "meganium": "http://cdn.bulbagarden.net/upload/thumb/d/d1/154Meganium.png/250px-154Meganium.png", - "cyndaquil": "http://cdn.bulbagarden.net/upload/thumb/9/9b/155Cyndaquil.png/250px-155Cyndaquil.png", - "quilava": "http://cdn.bulbagarden.net/upload/thumb/b/b6/156Quilava.png/250px-156Quilava.png", - "typhlosion": "http://cdn.bulbagarden.net/upload/thumb/4/47/157Typhlosion.png/250px-157Typhlosion.png", - "totodile": "http://cdn.bulbagarden.net/upload/thumb/d/df/158Totodile.png/250px-158Totodile.png", - "croconaw": "http://cdn.bulbagarden.net/upload/thumb/a/a5/159Croconaw.png/250px-159Croconaw.png", - "feraligatr": "http://cdn.bulbagarden.net/upload/thumb/d/d5/160Feraligatr.png/250px-160Feraligatr.png", - "sentret": "http://cdn.bulbagarden.net/upload/thumb/c/c5/161Sentret.png/250px-161Sentret.png", - "furret": "http://cdn.bulbagarden.net/upload/thumb/4/4b/162Furret.png/250px-162Furret.png", - "hoothoot": "http://cdn.bulbagarden.net/upload/thumb/5/53/163Hoothoot.png/250px-163Hoothoot.png", - "noctowl": "http://cdn.bulbagarden.net/upload/thumb/f/fa/164Noctowl.png/250px-164Noctowl.png", - "ledyba": "http://cdn.bulbagarden.net/upload/thumb/b/bb/165Ledyba.png/250px-165Ledyba.png", - "ledian": "http://cdn.bulbagarden.net/upload/thumb/5/5b/166Ledian.png/250px-166Ledian.png", - "spinarak": "http://cdn.bulbagarden.net/upload/thumb/7/75/167Spinarak.png/250px-167Spinarak.png", - "ariados": "http://cdn.bulbagarden.net/upload/thumb/7/76/168Ariados.png/250px-168Ariados.png", - "crobat": "http://cdn.bulbagarden.net/upload/thumb/1/17/169Crobat.png/250px-169Crobat.png", - "chinchou": "http://cdn.bulbagarden.net/upload/thumb/d/d9/170Chinchou.png/250px-170Chinchou.png", - "lanturn": "http://cdn.bulbagarden.net/upload/thumb/9/9b/171Lanturn.png/250px-171Lanturn.png", - "pichu": "http://cdn.bulbagarden.net/upload/thumb/b/b9/172Pichu.png/250px-172Pichu.png", - "cleffa": "http://cdn.bulbagarden.net/upload/thumb/e/e4/173Cleffa.png/250px-173Cleffa.png", - "igglybuff": "http://cdn.bulbagarden.net/upload/thumb/4/4d/174Igglybuff.png/250px-174Igglybuff.png", - "togepi": "http://cdn.bulbagarden.net/upload/thumb/6/6b/175Togepi.png/250px-175Togepi.png", - "togetic": "http://cdn.bulbagarden.net/upload/thumb/1/11/176Togetic.png/250px-176Togetic.png", - "natu": "http://cdn.bulbagarden.net/upload/thumb/5/5b/177Natu.png/250px-177Natu.png", - "xatu": "http://cdn.bulbagarden.net/upload/thumb/f/f4/178Xatu.png/250px-178Xatu.png", - "mareep": "http://cdn.bulbagarden.net/upload/thumb/6/6b/179Mareep.png/250px-179Mareep.png", - "flaaffy": "http://cdn.bulbagarden.net/upload/thumb/6/6f/180Flaaffy.png/250px-180Flaaffy.png", - "ampharos": "http://cdn.bulbagarden.net/upload/thumb/4/47/181Ampharos.png/250px-181Ampharos.png", - "bellossom": "http://cdn.bulbagarden.net/upload/thumb/c/cd/182Bellossom.png/250px-182Bellossom.png", - "marill": "http://cdn.bulbagarden.net/upload/thumb/4/42/183Marill.png/250px-183Marill.png", - "azumarill": "http://cdn.bulbagarden.net/upload/thumb/a/a5/184Azumarill.png/250px-184Azumarill.png", - "sudowoodo": "http://cdn.bulbagarden.net/upload/thumb/1/1e/185Sudowoodo.png/250px-185Sudowoodo.png", - "politoed": "http://cdn.bulbagarden.net/upload/thumb/a/a4/186Politoed.png/250px-186Politoed.png", - "hoppip": "http://cdn.bulbagarden.net/upload/thumb/f/f8/187Hoppip.png/250px-187Hoppip.png", - "skiploom": "http://cdn.bulbagarden.net/upload/thumb/4/4f/188Skiploom.png/250px-188Skiploom.png", - "jumpluff": "http://cdn.bulbagarden.net/upload/thumb/5/5e/189Jumpluff.png/250px-189Jumpluff.png", - "aipom": "http://cdn.bulbagarden.net/upload/thumb/4/42/190Aipom.png/250px-190Aipom.png", - "sunkern": "http://cdn.bulbagarden.net/upload/thumb/9/95/191Sunkern.png/250px-191Sunkern.png", - "sunflora": "http://cdn.bulbagarden.net/upload/thumb/9/98/192Sunflora.png/250px-192Sunflora.png", - "yanma": "http://cdn.bulbagarden.net/upload/thumb/d/dd/193Yanma.png/250px-193Yanma.png", - "wooper": "http://cdn.bulbagarden.net/upload/thumb/7/78/194Wooper.png/250px-194Wooper.png", - "quagsire": "http://cdn.bulbagarden.net/upload/thumb/a/a4/195Quagsire.png/250px-195Quagsire.png", - "espeon": "http://cdn.bulbagarden.net/upload/thumb/a/a7/196Espeon.png/250px-196Espeon.png", - "umbreon": "http://cdn.bulbagarden.net/upload/thumb/3/3d/197Umbreon.png/250px-197Umbreon.png", - "murkrow": "http://cdn.bulbagarden.net/upload/thumb/3/33/198Murkrow.png/250px-198Murkrow.png", - "slowking": "http://cdn.bulbagarden.net/upload/thumb/e/e1/199Slowking.png/250px-199Slowking.png", - "misdreavus": "http://cdn.bulbagarden.net/upload/thumb/b/be/200Misdreavus.png/250px-200Misdreavus.png", - "unown": "http://cdn.bulbagarden.net/upload/thumb/7/77/201Unown.png/250px-201Unown.png", - "wobbuffet": "http://cdn.bulbagarden.net/upload/thumb/1/17/202Wobbuffet.png/250px-202Wobbuffet.png", - "girafarig": "http://cdn.bulbagarden.net/upload/thumb/1/11/203Girafarig.png/250px-203Girafarig.png", - "pineco": "http://cdn.bulbagarden.net/upload/thumb/0/0b/204Pineco.png/250px-204Pineco.png", - "forretress": "http://cdn.bulbagarden.net/upload/thumb/6/68/205Forretress.png/250px-205Forretress.png", - "dunsparce": "http://cdn.bulbagarden.net/upload/thumb/2/20/206Dunsparce.png/250px-206Dunsparce.png", - "gligar": "http://cdn.bulbagarden.net/upload/thumb/0/04/207Gligar.png/250px-207Gligar.png", - "steelix": "http://cdn.bulbagarden.net/upload/thumb/b/ba/208Steelix.png/250px-208Steelix.png", - "snubbull": "http://cdn.bulbagarden.net/upload/thumb/7/7f/209Snubbull.png/250px-209Snubbull.png", - "granbull": "http://cdn.bulbagarden.net/upload/thumb/b/b1/210Granbull.png/250px-210Granbull.png", - "qwilfish": "http://cdn.bulbagarden.net/upload/thumb/2/21/211Qwilfish.png/250px-211Qwilfish.png", - "scizor": "http://cdn.bulbagarden.net/upload/thumb/5/55/212Scizor.png/250px-212Scizor.png", - "shuckle": "http://cdn.bulbagarden.net/upload/thumb/c/c7/213Shuckle.png/250px-213Shuckle.png", - "heracross": "http://cdn.bulbagarden.net/upload/thumb/4/47/214Heracross.png/250px-214Heracross.png", - "sneasel": "http://cdn.bulbagarden.net/upload/thumb/7/71/215Sneasel.png/250px-215Sneasel.png", - "teddiursa": "http://cdn.bulbagarden.net/upload/thumb/e/e9/216Teddiursa.png/250px-216Teddiursa.png", - "ursaring": "http://cdn.bulbagarden.net/upload/thumb/e/e9/217Ursaring.png/250px-217Ursaring.png", - "slugma": "http://cdn.bulbagarden.net/upload/thumb/6/68/218Slugma.png/250px-218Slugma.png", - "magcargo": "http://cdn.bulbagarden.net/upload/thumb/6/65/219Magcargo.png/250px-219Magcargo.png", - "swinub": "http://cdn.bulbagarden.net/upload/thumb/b/b5/220Swinub.png/250px-220Swinub.png", - "piloswine": "http://cdn.bulbagarden.net/upload/thumb/4/49/221Piloswine.png/250px-221Piloswine.png", - "corsola": "http://cdn.bulbagarden.net/upload/thumb/f/fc/222Corsola.png/250px-222Corsola.png", - "remoraid": "http://cdn.bulbagarden.net/upload/thumb/9/95/223Remoraid.png/250px-223Remoraid.png", - "octillery": "http://cdn.bulbagarden.net/upload/thumb/c/cb/224Octillery.png/250px-224Octillery.png", - "delibird": "http://cdn.bulbagarden.net/upload/thumb/3/3f/225Delibird.png/250px-225Delibird.png", - "mantine": "http://cdn.bulbagarden.net/upload/thumb/c/c5/226Mantine.png/250px-226Mantine.png", - "skarmory": "http://cdn.bulbagarden.net/upload/thumb/3/35/227Skarmory.png/250px-227Skarmory.png", - "houndour": "http://cdn.bulbagarden.net/upload/thumb/5/53/228Houndour.png/250px-228Houndour.png", - "houndoom": "http://cdn.bulbagarden.net/upload/thumb/5/51/229Houndoom.png/250px-229Houndoom.png", - "kingdra": "http://cdn.bulbagarden.net/upload/thumb/3/3c/230Kingdra.png/250px-230Kingdra.png", - "phanpy": "http://cdn.bulbagarden.net/upload/thumb/d/d3/231Phanpy.png/250px-231Phanpy.png", - "donphan": "http://cdn.bulbagarden.net/upload/thumb/5/53/232Donphan.png/250px-232Donphan.png", - "porygon2": "http://cdn.bulbagarden.net/upload/thumb/9/99/233Porygon2.png/250px-233Porygon2.png", - "stantler": "http://cdn.bulbagarden.net/upload/thumb/5/50/234Stantler.png/250px-234Stantler.png", - "smeargle": "http://cdn.bulbagarden.net/upload/thumb/9/92/235Smeargle.png/250px-235Smeargle.png", - "tyrogue": "http://cdn.bulbagarden.net/upload/thumb/c/c7/236Tyrogue.png/250px-236Tyrogue.png", - "hitmontop": "http://cdn.bulbagarden.net/upload/thumb/9/94/237Hitmontop.png/250px-237Hitmontop.png", - "smoochum": "http://cdn.bulbagarden.net/upload/thumb/0/0e/238Smoochum.png/250px-238Smoochum.png", - "elekid": "http://cdn.bulbagarden.net/upload/thumb/5/5d/239Elekid.png/250px-239Elekid.png", - "magby": "http://cdn.bulbagarden.net/upload/thumb/c/cb/240Magby.png/250px-240Magby.png", - "miltank": "http://cdn.bulbagarden.net/upload/thumb/1/13/241Miltank.png/250px-241Miltank.png", - "blissey": "http://cdn.bulbagarden.net/upload/thumb/5/56/242Blissey.png/250px-242Blissey.png", - "raikou": "http://cdn.bulbagarden.net/upload/thumb/c/c1/243Raikou.png/250px-243Raikou.png", - "entei": "http://cdn.bulbagarden.net/upload/thumb/f/f9/244Entei.png/250px-244Entei.png", - "suicune": "http://cdn.bulbagarden.net/upload/thumb/d/da/245Suicune.png/250px-245Suicune.png", - "larvitar": "http://cdn.bulbagarden.net/upload/thumb/7/70/246Larvitar.png/250px-246Larvitar.png", - "pupitar": "http://cdn.bulbagarden.net/upload/thumb/a/a1/247Pupitar.png/250px-247Pupitar.png", - "tyranitar": "http://cdn.bulbagarden.net/upload/thumb/8/82/248Tyranitar.png/250px-248Tyranitar.png", - "lugia": "http://cdn.bulbagarden.net/upload/thumb/4/44/249Lugia.png/250px-249Lugia.png", - "ho-oh": "http://cdn.bulbagarden.net/upload/thumb/6/67/250Ho-Oh.png/250px-250Ho-Oh.png", - "celebi": "http://cdn.bulbagarden.net/upload/thumb/e/e7/251Celebi.png/250px-251Celebi.png" - }, "type": { "bulbasaur": "Grass/Poison", "ivysaur": "Grass/Poison", diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index 7a619f2f..384af8e1 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -2,10 +2,13 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const pokedex = require('./pkdex.json'); -class PokedexCommand extends commando.Command { +module.exports = class PokedexCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'pokedex', + name: 'pokedex', + aliases: [ + 'pokemon' + ], group: 'search', memberName: 'pokedex', description: 'Gives the pokedex entry for a Pokemon. (;pokedex Pikachu)', @@ -13,22 +16,20 @@ class PokedexCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); let pokemon = message.content.toLowerCase().split(" ").slice(1).join(" "); if (pokedex.name[pokemon]) { const embed = new Discord.RichEmbed() .setTitle('Information') - .setAuthor(pokedex.name[pokemon], pokedex.sprite[pokemon]) + .setAuthor('#' + pokedex.index[pokemon] + " " + pokedex.name[pokemon], 'http://www.serebii.net/pokedex-sm/icon/' + pokedex.index[pokemon] + '.png') .setColor(0xFF0000) .setDescription(pokedex.species[pokemon]) - .setFooter(pokedex.dexname, pokedex.dexicon) - .setThumbnail(pokedex.picture[pokemon]) + .setFooter("Pokédex", "http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pokédex.png/250px-479Rotom-Pokédex.png") + .setThumbnail('http://www.serebii.net/sunmoon/pokemon/' + pokedex.index[pokemon] + '.png') .addField('Entry', pokedex.entry[pokemon]) .addField('Type', @@ -38,6 +39,4 @@ class PokedexCommand extends commando.Command { message.channel.send(":x: This Pokémon either doesn't exist, or isn't implemented yet."); } } -} - -module.exports = PokedexCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/urban.js b/commands/search/urban.js index ed31b9bb..d2060ba9 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -2,10 +2,15 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const urban = require('urban'); -class UrbanDictionary extends commando.Command { +module.exports = class UrbanDictionary extends commando.Command { constructor(Client){ super(Client, { - name: 'urban', + name: 'urban', + aliases: [ + 'urbandictionary', + 'urbandefine', + 'urbandefinition' + ], group: 'search', memberName: 'urban', description: 'Searches Urban Dictionary. (;urban Cat)', @@ -13,39 +18,36 @@ class UrbanDictionary 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 wordtodefine = message.content.split(" ").slice(1).join(" "); - urban(wordtodefine).first(function(json) { - if(json === undefined) { + let wordToDefine = message.content.split(" ").slice(1).join(" "); + urban(wordToDefine).first(function(response) { + if(response === undefined) { message.channel.send(":x: Error! Word not found!"); - } else if(json.definition === '') { + } else if(response.definition === '') { message.channel.send(":x: Error! Word has no definition!"); - } else if(json.example !== '') { + } else if(response.example !== '') { const embed = new Discord.RichEmbed() .setColor(0x32a8f0) .setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png') - .setURL(json.permalink) - .setTitle(json.word) - .setDescription(json.definition.substr(0, 1900) + ' [Read the Rest Here!](' + json.permalink + ')') + .setURL(response.permalink) + .setTitle(response.word) + .setDescription(response.definition.substr(0, 1900) + ' [Read the Rest Here!](' + response.permalink + ')') .addField('**Example:**', - json.example.substr(0, 1900)); + response.example.substr(0, 1900)); message.channel.sendEmbed(embed).catch(console.error); } else { const embed = new Discord.RichEmbed() .setColor(0x32a8f0) .setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png') - .setURL(json.permalink) - .setTitle(json.word) - .setDescription(json.definition.substr(0, 1900) + ' [Read the Rest Here!](' + json.permalink + ')'); + .setURL(response.permalink) + .setTitle(response.word) + .setDescription(response.definition.substr(0, 1900) + ' [Read the Rest Here!](' + response.permalink + ')'); message.channel.sendEmbed(embed).catch(console.error); } }); } -} - -module.exports = UrbanDictionary; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index f27b0f39..4ea45c90 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -1,12 +1,12 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); const config = require('../../config.json'); -class WattpadCommand extends commando.Command { +module.exports = class WattpadCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'wattpad', + name: 'wattpad', group: 'search', memberName: 'wattpad', description: 'Searches Wattpad for a specified book. (;wattpad Heroes of Dreamland)', @@ -14,50 +14,38 @@ class WattpadCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let querybook = message.content.split(" ").slice(1).join(" "); - const options = { - method: 'GET', - uri: 'https://api.wattpad.com:443/v4/stories', - headers: { - 'Authorization': 'Basic ' + config.wattpadkey - }, - qs: { - query: querybook, - limit: 1 - }, - json: true - } - request(options).then(function (response) { + let queryBook = message.content.split(" ").slice(1).join(" "); + request + .get('https://api.wattpad.com:443/v4/stories') + .set({ 'Authorization': 'Basic ' + config.wattpadkey }) + .query({ query: queryBook, limit: 1 }) + .then(function (response) { const embed = new Discord.RichEmbed() .setColor(0xF89C34) .setAuthor('Wattpad', 'http://www.selfpubtoolbox.com/wp-content/uploads/2015/05/a6044fd3a88acd5043860484db972ca6.png') - .setURL(response.stories[0].url) - .setTitle(response.stories[0].title) - .setDescription(response.stories[0].description.substr(0, 1500) + " [Read the Rest Here!](" + response.stories[0].url + ")") + .setURL(response.body.stories[0].url) + .setTitle(response.body.stories[0].title) + .setDescription(response.body.stories[0].description.substr(0, 1500) + " [Read the Rest Here!](" + response.body.stories[0].url + ")") .addField('**Author:**', - response.stories[0].user, true) + response.body.stories[0].user, true) .addField('**Parts:**', - response.stories[0].numParts, true) + response.body.stories[0].numParts, true) .addField('**Created On:**', - response.stories[0].createDate, true) + response.body.stories[0].createDate, true) .addField('**Votes:**', - response.stories[0].voteCount, true) + response.body.stories[0].voteCount, true) .addField('**Reads:**', - response.stories[0].readCount, true) + response.body.stories[0].readCount, true) .addField('**Comments:**', - response.stories[0].commentCount, true); + response.body.stories[0].commentCount, true); message.channel.sendEmbed(embed).catch(console.error); }).catch(function (err) { message.channel.send(":x: Error! Book not Found!"); }); } -} - -module.exports = WattpadCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/weather.js b/commands/search/weather.js index 4af0c948..295346ee 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -2,10 +2,10 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const weather = require('yahoo-weather'); -class WeatherCommand extends commando.Command { +module.exports = class WeatherCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'weather', + name: 'weather', group: 'search', memberName: 'weather', description: 'Searches weather for a specified location. (;weather San Francisco)', @@ -13,15 +13,13 @@ class WeatherCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let locationtosearch = message.content.split(" ").slice(1).join(" "); - weather(locationtosearch, 'f').then(info => { + let locationToSearch = message.content.split(" ").slice(1).join(" "); + weather(locationToSearch, 'f').then(info => { const embed = new Discord.RichEmbed() .setColor(0x0000FF) .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') @@ -56,6 +54,4 @@ class WeatherCommand extends commando.Command { message.channel.send(":x: Error! Make sure you typed the location correctly!"); }); } -} - -module.exports = WeatherCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 973ec125..0d4c9809 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -1,35 +1,30 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); -class WikipediaCommand extends commando.Command { +module.exports = class WikipediaCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'wikipedia', + name: 'wikipedia', group: 'search', memberName: 'wikipedia', - description: 'Searches Wikipedia for something. (;wikipedia Cat **Note: CAsE SenSiTiVe!**)', + description: 'Searches Wikipedia for something. (;wikipedia Cat)', examples: [';wikipedia Cat'] }); } - 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let wikied = message.content.split(" ").slice(1).join("%20"); - const options = { - method: 'GET', - uri: "https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + wikied + "&exintro=&explaintext=&redirects=&formatversion=2", - json: true - } - request(options).then(function (response) { - let description = response.query.pages[0].extract; - let name = response.query.pages[0].title; - wikied = wikied.replace(")", "%29"); + let thingToSearch = message.content.split(" ").slice(1).join("%20"); + request + .get("https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + thingToSearch + "&exintro=&explaintext=&redirects=&formatversion=2") + .then(function (response) { + let description = response.body.query.pages[0].extract; + let name = response.body.query.pages[0].title; + thingToSearch = thingToSearch.split(")").join("%29"); if(description === undefined) { message.channel.send(":x: Error! Entry Not Found!"); } else { @@ -38,15 +33,13 @@ class WikipediaCommand extends commando.Command { const embed = new Discord.RichEmbed() .setColor(0xE7E7E7) .setTitle(name) - .setURL("https://en.wikipedia.org/wiki/" + wikied) + .setURL("https://en.wikipedia.org/wiki/" + thingToSearch) .setAuthor("Wikipedia", "https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1122px-Wikipedia-logo-v2.svg.png") - .setDescription(description + "\n\n" + "[Read the Rest Here](https://en.wikipedia.org/wiki/" + wikied + ")"); + .setDescription(description + "[Read the Rest Here](https://en.wikipedia.org/wiki/" + thingToSearch + ")"); message.channel.sendEmbed(embed).catch(console.error); } }).catch(function (err) { message.channel.send(":x: Error! Entry Not Found!"); }); } -} - -module.exports = WikipediaCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/youtube.js b/commands/search/youtube.js index 2a48b680..3b041d6f 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -1,12 +1,15 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); const config = require('../../config.json'); -class YouTubeCommand extends commando.Command { +module.exports = class YouTubeCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'youtube', + name: 'youtube', + aliases: [ + 'video' + ], group: 'search', memberName: 'youtube', description: 'Searches YouTube for a video. (;youtube video)', @@ -14,43 +17,30 @@ class YouTubeCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let videotosearch = message.content.split(" ").slice(1).join("-"); - const options = { - method: 'GET', - uri: 'https://www.googleapis.com/youtube/v3/search', - qs: { - part: 'snippet', - type: 'video', - maxResults: 1, - q: videotosearch, - key: config.youtubekey - }, - json: true - } - request(options).then(function (response) { - if(response.items[0].snippet === undefined) { + let videoToSearch = message.content.split(" ").slice(1).join("-"); + request + .get('https://www.googleapis.com/youtube/v3/search') + .query({ part: 'snippet', type: 'video', maxResults: 1, q: videoToSearch, key: config.youtubekey }) + .then(function (response) { + if(response.body.items[0].snippet === undefined) { message.channel.send(':x: Error! No Video Found!'); } else { const embed = new Discord.RichEmbed() .setColor(0xDD2825) - .setTitle(response.items[0].snippet.title) - .setDescription(response.items[0].snippet.description) - .setAuthor('YouTube - ' + response.items[0].snippet.channelTitle, 'https://cdn3.iconfinder.com/data/icons/social-icons-5/607/YouTube_Play.png') - .setURL('https://www.youtube.com/watch?v=' + response.items[0].id.videoId) - .setThumbnail(response.items[0].snippet.thumbnails.default.url); + .setTitle(response.body.items[0].snippet.title) + .setDescription(response.body.items[0].snippet.description) + .setAuthor('YouTube - ' + response.body.items[0].snippet.channelTitle, 'https://cdn3.iconfinder.com/data/icons/social-icons-5/607/YouTube_Play.png') + .setURL('https://www.youtube.com/watch?v=' + response.body.items[0].id.videoId) + .setThumbnail(response.body.items[0].snippet.thumbnails.default.url); message.channel.sendEmbed(embed).catch(console.error); } }).catch(function (err) { message.channel.send(":x: Error! An error has occurred! Try again (if this continues to occur, the daily quota may have been reached)."); }); } -} - -module.exports = YouTubeCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index 80a013e2..5f7b41cc 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -1,11 +1,11 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const request = require('request-promise'); +const request = require('superagent'); -class YuGiOhCommand extends commando.Command { +module.exports = class YuGiOhCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'yugioh', + name: 'yugioh', group: 'search', memberName: 'yugioh', description: 'Gets info on a Yu-Gi-Oh! Card. (;yugioh Blue-Eyes White Dragon)', @@ -13,53 +13,46 @@ class YuGiOhCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let cardname = message.content.split(" ").slice(1).join("%20"); - const options = { - method: 'GET', - uri: 'http://yugiohprices.com/api/card_data/' + cardname, - json: true - } - request(options).then(function (response) { + let cardName = message.content.split(" ").slice(1).join("%20"); + request + .get('http://yugiohprices.com/api/card_data/' + cardName) + .then(function (response) { if(response.data.card_type === 'monster') { const embed = new Discord.RichEmbed() .setColor(0xBE5F1F) - .setTitle(response.data.name) - .setDescription(response.data.text) + .setTitle(response.body.data.name) + .setDescription(response.body.data.text) .setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558') .addField('**Card Type:**', - response.data.card_type, true) + response.body.data.card_type, true) .addField('**Species:**', - response.data.type, true) + response.body.data.type, true) .addField('**Attribute:**', - response.data.family, true) + response.body.data.family, true) .addField('**ATK:**', - response.data.atk, true) + response.body.data.atk, true) .addField('**DEF:**', - response.data.def, true) + response.body.data.def, true) .addField('**Level:**', - response.data.level, true); + response.body.data.level, true); message.channel.sendEmbed(embed).catch(console.error); } else { const embed = new Discord.RichEmbed() .setColor(0xBE5F1F) - .setTitle(response.data.name) - .setDescription(response.data.text) + .setTitle(response.body.data.name) + .setDescription(response.body.data.text) .setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558') .addField('**Card Type:**', - response.data.card_type, true); + response.data.body.card_type, true); message.channel.sendEmbed(embed).catch(console.error); } }).catch(function (err) { message.channel.send(":x: Error! Card not Found!\n:notepad_spiral: Note: This command is **extremely** sensitive to casing and dashes and whatnot. Type the *exact* card name to get data!"); }); } -} - -module.exports = YuGiOhCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/binary.js b/commands/textedit/binary.js index 0ea9f376..ac57a49a 100644 --- a/commands/textedit/binary.js +++ b/commands/textedit/binary.js @@ -1,10 +1,10 @@ const commando = require('discord.js-commando'); const stringToBinary = require('string-to-binary'); -class BinaryCommand extends commando.Command { +module.exports = class BinaryCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'binary', + name: 'binary', group: 'textedit', memberName: 'binary', description: 'Converts text to binary. (;binary This text)', @@ -12,15 +12,12 @@ class BinaryCommand 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 turnToBinary = message.content.split(" ").slice(1).join(" "); message.channel.send(stringToBinary(turnToBinary)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!')); } -} - -module.exports = BinaryCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/cowsay.js b/commands/textedit/cowsay.js index 21df7899..01b40256 100644 --- a/commands/textedit/cowsay.js +++ b/commands/textedit/cowsay.js @@ -1,10 +1,10 @@ const commando = require('discord.js-commando'); const cowsay = require('cowsay'); -class CowsayCommand extends commando.Command { +module.exports = class CowsayCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'cowsay', + name: 'cowsay', group: 'textedit', memberName: 'cowsay', description: 'Converts text to cowsay. (;cowsay This text)', @@ -12,10 +12,9 @@ class CowsayCommand 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); if(message.content.split(" ").slice(1).join(" ") === "") { @@ -31,6 +30,4 @@ class CowsayCommand extends commando.Command { }); } } -} - -module.exports = CowsayCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/embed.js b/commands/textedit/embed.js index 2960f1c0..9e48eacc 100644 --- a/commands/textedit/embed.js +++ b/commands/textedit/embed.js @@ -1,10 +1,10 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class EmbedCommand extends commando.Command { +module.exports = class EmbedCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'embed', + name: 'embed', group: 'textedit', memberName: 'embed', description: 'Sends a message in an embed. (;embed This is an example.)', @@ -12,27 +12,23 @@ class EmbedCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - let embedmessage = message.content.split(" ").slice(1).join(" "); - if(embedmessage === "") { + let embedMessage = message.content.split(" ").slice(1).join(" "); + if(embedMessage === "") { message.channel.send(":x: Error! Nothing to embed!"); } else { const embed = new Discord.RichEmbed() .setAuthor(message.author.username, message.author.avatarURL) .setColor(0x00AE86) .setTimestamp() - .setDescription(embedmessage); + .setDescription(embedMessage); message.channel.sendEmbed(embed).catch(console.error); if (message.channel.type === 'dm') return; message.delete(); } } -} - -module.exports = EmbedCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/morse.js b/commands/textedit/morse.js index 0ea396d7..906db7d2 100644 --- a/commands/textedit/morse.js +++ b/commands/textedit/morse.js @@ -1,10 +1,13 @@ const commando = require('discord.js-commando'); const morse = require('morse'); -class MorseCommand extends commando.Command { +module.exports = class MorseCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'morse', + name: 'morse', + aliases: [ + 'morsecode' + ], group: 'textedit', memberName: 'morse', description: 'Translates text to and from morse code. (;morse encode This is Morse Code.)', @@ -12,10 +15,9 @@ class MorseCommand 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 [methodToUse] = message.content.toLowerCase().split(" ").slice(1); @@ -30,6 +32,4 @@ class MorseCommand extends commando.Command { message.channel.send(":x: Error! Method not set/not correct! Use either encode or decode."); } } -} - -module.exports = MorseCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/pirate.js b/commands/textedit/pirate.js index 4e2ca461..9c493003 100644 --- a/commands/textedit/pirate.js +++ b/commands/textedit/pirate.js @@ -1,10 +1,14 @@ const commando = require('discord.js-commando'); const pirateSpeak = require('pirate-speak'); -class PirateCommand extends commando.Command { +module.exports = class PirateCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'pirate', + name: 'pirate', + aliases: [ + 'piratespeak', + 'yarr' + ], group: 'textedit', memberName: 'pirate', description: 'Talk like a pirate! (;pirate This is being said like a pirate!)', @@ -12,15 +16,14 @@ class PirateCommand 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 messagecontent = message.content.split(" ").slice(1).join(" "); - let pirate = pirateSpeak.translate(messagecontent); - if(messagecontent === "") { + let turnToPirate = message.content.split(" ").slice(1).join(" "); + let pirate = pirateSpeak.translate(turnToPirate); + if(turnToPirate === "") { message.channel.send(":x: Error! Nothing to translate!"); } else { if(pirate.length > 1950) { @@ -30,6 +33,4 @@ class PirateCommand extends commando.Command { } } } -} - -module.exports = PirateCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/reverse.js b/commands/textedit/reverse.js index cb8dc738..805879d8 100644 --- a/commands/textedit/reverse.js +++ b/commands/textedit/reverse.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class ReverseCommand extends commando.Command { +module.exports = class ReverseCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'reverse', + name: 'reverse', group: 'textedit', memberName: 'reverse', description: 'Reverses text (;reverse This text please)', @@ -11,23 +11,17 @@ class ReverseCommand 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); - function reverseString(str) { - return str.split("").reverse().join(""); - } - let messagecontent = message.content.split(" ").slice(1).join(" "); - if(messagecontent === "") { + let stringToReverse = message.content.split(" ").slice(1).join(" "); + if(stringToReverse === "") { message.channel.send(":x: Error! Nothing to reverse!"); } else { - let reversed = reverseString(messagecontent); + let reversed = stringToReverse.split("").reverse().join(""); message.channel.send(reversed); } } -} - -module.exports = ReverseCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/rin.js b/commands/textedit/rin.js index d909cf7b..00ad3610 100644 --- a/commands/textedit/rin.js +++ b/commands/textedit/rin.js @@ -1,11 +1,14 @@ const commando = require('discord.js-commando'); -const request = require('request-promise'); +const request = require('superagent'); const config = require('../../config.json'); -class RinSayCommand extends commando.Command { +module.exports = class RinSayCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'rin', + name: 'rin', + aliases: [ + 'rinsay' + ], group: 'textedit', memberName: 'rin', description: "Posts a message to the Rin webhook in Heroes of Dreamland. (;rin Hey guys!)", @@ -16,28 +19,22 @@ class RinSayCommand extends commando.Command { return this.client.isOwner(msg.author); } - 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 rinContent = message.content.split(" ").slice(1).join(" "); - const sendPOST = { - method: 'POST', - uri: config.webhook, - body: { - content: rinContent - }, - json: true - } - request(sendPOST).then(function (parsedBody) { - if(message.channel.type === 'dm') return; + request + .post(config.webhook) + .send({ content: rinContent }) + .then(function (parsedBody) { + message.channel.send('Message sent to the Rin Webhook!'); + if(message.content.type === 'dm') return; message.delete(); }).catch(function (err) { + message.channel.send(':x: Error! Message failed to send! Check the logs for details.'); console.log(err); }); } -} - -module.exports = RinSayCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/romaji.js b/commands/textedit/romaji.js index 5f031c88..dc5bc118 100644 --- a/commands/textedit/romaji.js +++ b/commands/textedit/romaji.js @@ -1,10 +1,13 @@ const commando = require('discord.js-commando'); const hepburn = require('hepburn'); -class RomajiCommand extends commando.Command { +module.exports = class RomajiCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'romaji', + name: 'romaji', + aliases: [ + 'romajify' + ], group: 'textedit', memberName: 'romaji', description: 'Convert Hiragana and Katakana to Romaji (;romaji ひらがな)', @@ -12,10 +15,9 @@ class RomajiCommand 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 romajify = message.content.split(" ").slice(1).join(" "); @@ -30,6 +32,4 @@ class RomajiCommand extends commando.Command { message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!"); } } -} - -module.exports = RomajiCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/say.js b/commands/textedit/say.js index 00544ec6..8a1474d4 100644 --- a/commands/textedit/say.js +++ b/commands/textedit/say.js @@ -1,9 +1,14 @@ const commando = require('discord.js-commando'); -class SayCommand extends commando.Command { +module.exports = class SayCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'say', + name: 'say', + aliases: [ + 'copy', + 'repeat', + 'parrot' + ], group: 'textedit', memberName: 'say', description: 'Make XiaoBot say what you wish. (;say I can talk!)', @@ -11,21 +16,18 @@ class SayCommand 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 Copycat = message.content.split(" ").slice(1).join(" "); - if(Copycat === "") { + let copycat = message.content.split(" ").slice(1).join(" "); + if(copycat === "") { message.channel.send(":x: Error! Nothing to say!"); } else { - message.channel.send(Copycat); + message.channel.send(copycat); if (message.channel.type === 'dm') return; message.delete(); } } -} - -module.exports = SayCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/shuffle.js b/commands/textedit/shuffle.js index e9b5af77..509becc1 100644 --- a/commands/textedit/shuffle.js +++ b/commands/textedit/shuffle.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class ShuffleCommand extends commando.Command { +module.exports = class ShuffleCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'shuffle', + name: 'shuffle', group: 'textedit', memberName: 'shuffle', description: 'Shuffles text (;shuffle This Text)', @@ -11,30 +11,27 @@ class ShuffleCommand 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); String.prototype.shuffle = function () { - var a = this.split(""), + let a = this.split(""), n = a.length; - for(var i = n - 1; i > 0; i--) { - var j = Math.floor(Math.random() * (i + 1)); - var tmp = a[i]; + for(let i = n - 1; i > 0; i--) { + let j = Math.floor(Math.random() * (i + 1)); + let tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a.join(""); - } - let shuffled = message.content.split(" ").slice(1).join(" "); - if(shuffled === '') { + }; + let thingToShuffle = message.content.split(" ").slice(1).join(" "); + if(thingToShuffle === '') { message.channel.send(":x: Error! Nothing to shuffle!"); } else { - message.channel.send(shuffled.shuffle()); + message.channel.send(thingToShuffle.shuffle()); } } -} - -module.exports = ShuffleCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/translate.js b/commands/textedit/translate.js index 878cbed2..09fc27a7 100644 --- a/commands/textedit/translate.js +++ b/commands/textedit/translate.js @@ -3,51 +3,47 @@ const Discord = require('discord.js'); const translate = require('google-translate-api'); const languages = require('./languages.json'); -class TranslateCommand extends commando.Command { +module.exports = class TranslateCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'translate', + name: 'translate', group: 'textedit', memberName: 'translate', - description: 'Translates text to a given language. (;translate ja Give me the money!) (;translate list to see avaliable language codes!)', + description: 'Translates text to a given language. (;translate ja Give me the money!)', examples: [';translate ja Give me the the money!', ';translate list'] }); } - 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); let [languageto] = message.content.toLowerCase().split(" ").slice(1); - let messagecontent = message.content.split(" ").slice(2).join(" "); + let thingToTranslate = message.content.split(" ").slice(2).join(" "); if(languageto === "list") { message.channel.send("‘af': 'Afrikaans’\n’sq': 'Albanian'\n'ar': 'Arabic’\n’hy': 'Armenian’\n’az': 'Azerbaijani’\n’eu': 'Basque’\n’be': 'Belarusian’\n’bn': 'Bengali’\n’bs': 'Bosnian’\n’bg': 'Bulgarian’\n’ca': 'Catalan’\n’ceb': 'Cebuano’\n’ny': 'Chichewa’\n’zh-cn': 'Chinese Simplified’\n’zh-tw': 'Chinese Traditional’\n’co': 'Corsican’\n’hr': 'Croatian’\n’cs': 'Czech’\n’da': 'Danish’\n’nl': 'Dutch’\n’en': 'English’\n’eo': 'Esperanto’\n’et': 'Estonian’\n’tl': 'Filipino’\n’fi': 'Finnish’\n’fr': 'French’\n’fy': 'Frisian’\n’gl': 'Galician’\n’ka': 'Georgian’\n’de': 'German’\n’el': 'Greek’\n’gu': 'Gujarati’\n’ht': 'Haitian Creole’\n’ha': 'Hausa’\n’haw': 'Hawaiian’\n’iw': 'Hebrew’\n’hi': 'Hindi’\n’hmn': 'Hmong’\n’hu': 'Hungarian’\n’is': 'Icelandic’\n’ig': 'Igbo’\n’id': 'Indonesian’\n’ga': 'Irish’\n’it': 'Italian’\n’ja': 'Japanese’\n’jw': 'Javanese’\n’kn': 'Kannada’\n’kk': 'Kazakh’\n’km': 'Khmer’\n’ko': 'Korean’\n’ku': 'Kurdish (Kurmanji)’\n’ky': 'Kyrgyz’\n’lo': 'Lao’\n’la': 'Latin’\n’lv': 'Latvian’\n’lt': 'Lithuanian’\n’lb': 'Luxembourgish’\n’mk': 'Macedonian’\n’mg': 'Malagasy’\n’ms': 'Malay’\n’ml': 'Malayalam’\n’mt': 'Maltese’\n’mi': 'Maori’\n’mr': 'Marathi’\n’mn': 'Mongolian’\n’my': 'Myanmar (Burmese)’\n’ne': 'Nepali’\n’no': 'Norwegian’\n’ps': 'Pashto’\n’fa': 'Persian’\n’pl': 'Polish’\n’pt': 'Portuguese’\n’ma': 'Punjabi’\n’ro': 'Romanian’\n’ru': 'Russian’\nsm': 'Samoan’\n’gd': 'Scots Gaelic’\n’sr': 'Serbian’\n’st': 'Sesotho’\n’sn': 'Shona’\n’sd': 'Sindhi’\n’si': 'Sinhala’\n’sk': 'Slovak’\n’sl': 'Slovenian’\n’so': 'Somali’\n’es': 'Spanish’\n’su': 'Sudanese’\n’sw': 'Swahili’\n’sv': 'Swedish’\n’tg': 'Tajik’\n’ta': 'Tamil’\n’te': 'Telugu’\n’th': 'Thai’\n’tr': 'Turkish’\n’uk': 'Ukrainian’\n’ur': 'Urdu’\n’uz': 'Uzbek’\n’vi': 'Vietnamese’\n’cy': 'Welsh’\n’xh': 'Xhosa’\n’yi': 'Yiddish’\n’yo': 'Yoruba’\n’zu': 'Zulu'"); } else if(languages.entries[languageto]) { - if(messagecontent === "") { + if(thingToTranslate === "") { message.channel.send(":x: Error! Nothing to translate!"); - } else if(messagecontent.length > 200) { + } else if(thingToTranslate.length > 200) { message.channel.send(":x: Error! Please keep translations below 200 characters!"); } else { - translate(messagecontent, {to: languageto}).then(res => { + translate(thingToTranslate, {to: languageto}).then(res => { let languagefrom = res.from.language.iso.toLowerCase(); const embed = new Discord.RichEmbed() .setColor(0x00AE86) .addField('Input (From: ' + languages.entries[languagefrom] + '):', - messagecontent) + thingToTranslate) .addField('Translation (To: ' + languages.entries[languageto] + '):', res.text); message.channel.sendEmbed(embed).catch(console.error); }).catch(err => { - message.channel.send(":x: Error!"); + message.channel.send(":x: Error! Something went wrong!"); }); } } else { - message.channel.send(":x: Error! Language not found!"); + message.channel.send(":x: Error! Language not found! Use `;translate list` to view a list of translate codes!"); } } -} - -module.exports = TranslateCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/yoda.js b/commands/textedit/yoda.js index b3dbbd0b..638eedee 100644 --- a/commands/textedit/yoda.js +++ b/commands/textedit/yoda.js @@ -1,11 +1,11 @@ const commando = require('discord.js-commando'); -const request = require('request-promise'); +const request = require('superagent'); const config = require('../../config.json'); -class YodaCommand extends commando.Command { +module.exports = class YodaCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'yoda', + name: 'yoda', group: 'textedit', memberName: 'yoda', description: 'Converts text to Yoda Speak. (;yoda This is Yoda.)', @@ -13,39 +13,28 @@ class YodaCommand 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 yodaspeak = message.content.split(" ").slice(1).join(" "); - if(yodaspeak === "") { + let turnToYoda = message.content.split(" ").slice(1).join(" "); + if(turnToYoda === "") { message.channel.send(':x: Error! Nothing to translate!'); } else { - const options = { - method: 'GET', - uri: 'https://yoda.p.mashape.com/yoda', - qs: { - sentence: yodaspeak - }, - headers: { - 'X-Mashape-Key': config.mashapekey, - 'Accept': "text/plain" - }, - json: true - } - request(options).then(function (response) { + request + .get('https://yoda.p.mashape.com/yoda') + .set({ 'X-Mashape-Key': config.mashapekey, 'Accept': 'text/plain' }) + .query({ sentence: turnToYoda }) + .then(function (response) { if(response === undefined) { message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'); } else { - message.channel.send(response).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.')); + message.channel.send(response.body).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.')); } }).catch(function (err) { message.channel.send(":x: Error! Unknown Error. Try again later!"); }); } } -} - -module.exports = YodaCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/textedit/zalgo.js b/commands/textedit/zalgo.js index ba2152d8..7882b487 100644 --- a/commands/textedit/zalgo.js +++ b/commands/textedit/zalgo.js @@ -1,10 +1,10 @@ const commando = require('discord.js-commando'); const zalgo = require('zalgolize'); -class ZalgoCommand extends commando.Command { +module.exports = class ZalgoCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'zalgo', + name: 'zalgo', group: 'textedit', memberName: 'zalgo', description: 'Zalgoizes Text (;zalgo This Text)', @@ -12,10 +12,9 @@ class ZalgoCommand 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 zalgoified = zalgo(message.content.split(" ").slice(1).join(" ")); @@ -27,6 +26,4 @@ class ZalgoCommand extends commando.Command { message.channel.send(zalgoified); } } -} - -module.exports = ZalgoCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/userinfo/avatar.js b/commands/userinfo/avatar.js index d3ea276e..4865448c 100644 --- a/commands/userinfo/avatar.js +++ b/commands/userinfo/avatar.js @@ -1,9 +1,9 @@ const commando = require('discord.js-commando'); -class AvatarCommand extends commando.Command { +module.exports = class AvatarCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'avatar', + name: 'avatar', group: 'userinfo', memberName: 'avatar', description: "Gives a link to someone's avatar. (;avatar @User)", @@ -11,22 +11,19 @@ class AvatarCommand 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); if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if(message.mentions.users.first().avatarURL === null) { - message.channel.send(":x: This person has no avatar!"); + message.channel.send(":x: Error! This person has no avatar!"); } else { message.channel.send(message.mentions.users.first().avatarURL); } } } -} - -module.exports = AvatarCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/userinfo/userinfo.js b/commands/userinfo/userinfo.js index e1b10c1e..a5eafbbf 100644 --- a/commands/userinfo/userinfo.js +++ b/commands/userinfo/userinfo.js @@ -1,10 +1,15 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -class UserInfoCommand extends commando.Command { +module.exports = class UserInfoCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'user', + name: 'user', + aliases: [ + 'userinfo', + 'member', + 'memberinfo' + ], group: 'userinfo', memberName: 'user', description: "Gives some info on a user. (;user @User)", @@ -12,17 +17,12 @@ class UserInfoCommand 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('EMBED_LINKS')) return; + if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - if (message.channel.type === 'dm') { - message.channel.send(":x: This is a DM!"); - } else { - let member = message.guild.member(message.mentions.users.first()); + if (message.channel.type !== 'dm') { let stat; switch (message.mentions.users.first().presence.status) { case "online": @@ -54,7 +54,7 @@ class UserInfoCommand extends commando.Command { break; } if (message.mentions.users.size !== 1) { - message.channel.send(':x: Either too many or no members, only mention one person!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (message.mentions.users.first().presence.game === null) { const embed = new Discord.RichEmbed() @@ -67,7 +67,7 @@ class UserInfoCommand extends commando.Command { .addField('**Joined Discord On:**', message.mentions.users.first().createdAt, true) .addField('**Joined Server On:**', - member.joinedAt, true) + message.guild.member(message.mentions.users.first()).joinedAt, true) .addField('**Status:**', stat, true) .addField('**Playing:**', @@ -84,7 +84,7 @@ class UserInfoCommand extends commando.Command { .addField('**Joined Discord On:**', message.mentions.users.first().createdAt, true) .addField('**Joined Server On:**', - member.joinedAt, true) + message.guild.member(message.mentions.users.first()).joinedAt, true) .addField('**Status:**', stat, true) .addField('**Playing:**', @@ -92,8 +92,8 @@ class UserInfoCommand extends commando.Command { message.channel.sendEmbed(embed).catch(console.error); } } + } else { + message.channel.send(":x: Error! This command does not work in DM!"); } } -} - -module.exports = UserInfoCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/commands/util/servers.js b/commands/util/servers.js index 7e2e7e8d..ed94796a 100644 --- a/commands/util/servers.js +++ b/commands/util/servers.js @@ -1,9 +1,12 @@ const commando = require('discord.js-commando'); -class ServersCommand extends commando.Command { +module.exports = class ServersCommand extends commando.Command { constructor(Client){ super(Client, { - name: 'servers', + name: 'servers', + aliases: [ + 'serverlist' + ], group: 'util', memberName: 'servers', description: "Sends a list of all server names and IDs to the log.", @@ -14,15 +17,12 @@ class ServersCommand extends commando.Command { return this.client.isOwner(msg.author); } - 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); console.log(this.client.guilds.array().length + " Servers: " + this.client.guilds.map(g => g.name + " (" + g.id + ")").join(", ")); message.channel.send("Sent the information to the console!"); } -} - -module.exports = ServersCommand; \ No newline at end of file +}; \ No newline at end of file diff --git a/index.js b/index.js index adde1d1f..fd89bfb7 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ const Discord = require('discord.js'); const commando = require('discord.js-commando'); const config = require('./config.json'); -const request = require('request-promise'); +const request = require('superagent'); const clevusers = require('./clevusers.json'); const client = new commando.Client({ commandPrefix: ';', @@ -43,10 +43,6 @@ client.on('message', (message) => { console.log("[Command] " + message.content); message.channel.send("Calm down! ┬─┬ ノ( ゜-゜ノ)"); } - if(message.content.includes(":Swagolor:")) { - if(message.guild.id !== config.server) return; - message.react(message.guild.emojis.get('254827709459333120')); - } if (message.content.startsWith("<@" + client.user.id + ">")){ if(message.guild.id === config.server || message.author.id === config.owner || message.guild.id === config.personalServer) { console.log("[Cleverbot] " + message.content); @@ -79,35 +75,22 @@ client.on('guildMemberRemove', member => { client.on('guildCreate', guild => { console.log("[Guild] I have joined the guild: " + guild.name + ", " + guild.owner.user.username + " (" + guild.id + ")!"); - client.guilds.get(config.server).channels.get('265503171835592704').send("I have joined the guild: " + guild.name + " (Owner: " + guild.owner.user.username + ")!"); + client.guilds.get(config.server).channels.get(config.announcementChannel).send("I have joined the guild: " + guild.name + " (Owner: " + guild.owner.user.username + ")!"); client.shard.fetchClientValues('guilds.size').then(results => { console.log("[Guild Count] " + results.reduce((prev, val) => prev + val, 0)); - const carbonPOST = { - method: 'POST', - uri: 'https://www.carbonitex.net/discord/data/botdata.php', - body: { - key: config.carbonkey, - servercount: results.reduce((prev, val) => prev + val, 0) - }, - json: true - } - const DBotsPOST = { - method: 'POST', - uri: 'https://bots.discord.pw/api/bots/' + config.botid + '/stats', - body: { - server_count: results.reduce((prev, val) => prev + val, 0) - }, - headers: { - 'Authorization': config.botskey - }, - json: true - } - request(carbonPOST).then(function (parsedBody) { + request + .post('https://www.carbonitex.net/discord/data/botdata.php') + .send({ key: config.carbonkey, servercount: results.reduce((prev, val) => prev + val, 0) }) + .then(function (parsedBody) { console.log('[Carbon] Successfully posted to Carbon.'); }).catch(function (err) { console.log("[Carbon] Failed to post to Carbon."); }); - request(DBotsPOST).then(function (parsedBody) { + request + .post('https://bots.discord.pw/api/bots/' + config.botid + '/stats') + .set({ 'Authorization': config.botskey }) + .send({ server_count: results.reduce((prev, val) => prev + val, 0) }) + .then(function (parsedBody) { console.log('[Discord Bots] Successfully posted to Discord Bots.'); }).catch(function (err) { console.log("[Discord Bots] Failed to post to Discord Bots."); @@ -120,32 +103,19 @@ client.on('guildDelete', guild => { client.guilds.get(config.server).channels.get('265503171835592704').send("I have left the guild: " + guild.name + " (Owner: " + guild.owner.user.username + ")..."); client.shard.fetchClientValues('guilds.size').then(results => { console.log("[Guild Count] " + results.reduce((prev, val) => prev + val, 0)); - const carbonPOST = { - method: 'POST', - uri: 'https://www.carbonitex.net/discord/data/botdata.php', - body: { - key: config.carbonkey, - servercount: results.reduce((prev, val) => prev + val, 0) - }, - json: true - } - const DBotsPOST = { - method: 'POST', - uri: 'https://bots.discord.pw/api/bots/' + config.botid + '/stats', - body: { - server_count: results.reduce((prev, val) => prev + val, 0) - }, - headers: { - 'Authorization': config.botskey - }, - json: true - } - request(carbonPOST).then(function (parsedBody) { + request + .post('https://www.carbonitex.net/discord/data/botdata.php') + .send({ key: config.carbonkey, servercount: results.reduce((prev, val) => prev + val, 0) }) + .then(function (parsedBody) { console.log('[Carbon] Successfully posted to Carbon.'); }).catch(function (err) { console.log("[Carbon] Failed to post to Carbon."); }); - request(DBotsPOST).then(function (parsedBody) { + request + .post('https://bots.discord.pw/api/bots/' + config.botid + '/stats') + .set({ 'Authorization': config.botskey }) + .send({ server_count: results.reduce((prev, val) => prev + val, 0) }) + .then(function (parsedBody) { console.log('[Discord Bots] Successfully posted to Discord Bots.'); }).catch(function (err) { console.log("[Discord Bots] Failed to post to Discord Bots."); diff --git a/package.json b/package.json index c45d5d07..0a174381 100644 --- a/package.json +++ b/package.json @@ -30,10 +30,9 @@ "morse": "^0.1.0", "opusscript": "0.0.3", "pirate-speak": "^1.0.1", - "request": "^2.81.0", - "request-promise": "^4.1.1", "roman-numeral-converter-mmxvi": "^1.0.5", "string-to-binary": "^0.1.2", + "superagent": "^3.5.1", "urban": "^0.3.1", "yahoo-weather": "^2.2.2", "zalgolize": "^1.2.4"