diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index f39d0eee..d40bc81d 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -21,11 +21,11 @@ module.exports = class YearsCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.mentions.users.size !== 1) { - let errorMes1 = await message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().avatarURL) { - let errorMes2 = await message.channel.send(":x: Error! This user has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { let userAvatar = message.mentions.users.first().avatarURL; @@ -39,7 +39,7 @@ module.exports = class YearsCommand extends commando.Command { years.blit(avatar, 461, 127); years.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) throw err; - message.channel.sendFile(buff); + return message.channel.sendFile(buff); }); } } diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index de0baaa4..56620168 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -21,11 +21,11 @@ module.exports = class BeautifulCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.mentions.users.size !== 1) { - let errorMes1 = await message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().avatarURL) { - let errorMes2 = await message.channel.send(":x: Error! This user has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { let userAvatar = message.mentions.users.first().avatarURL; @@ -41,7 +41,7 @@ module.exports = class BeautifulCommand extends commando.Command { beautiful.blit(avatar, 451, 434); beautiful.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) throw err; - message.channel.sendFile(buff); + return message.channel.sendFile(buff); }); } } diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index bf358933..61f406e8 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -22,11 +22,11 @@ module.exports = class BobRossCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.mentions.users.size !== 1) { - return message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().avatarURL) { - return message.channel.send(":x: Error! This user has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { let userAvatar = message.mentions.users.first().avatarURL; @@ -43,7 +43,7 @@ module.exports = class BobRossCommand extends commando.Command { nothing.composite(bob, 0, 0); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) throw err; - message.channel.sendFile(buff); + return message.channel.sendFile(buff); }); } } diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index 9b0b542c..464132e8 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -22,11 +22,11 @@ module.exports = class RIPCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.mentions.users.size !== 1) { - let errorMes1 = await message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().avatarURL) { - let errorMes2 = await message.channel.send(":x: Error! This user has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { let userAvatar = message.mentions.users.first().avatarURL; @@ -40,7 +40,7 @@ module.exports = class RIPCommand extends commando.Command { gravestone.blit(avatar, 60, 65); gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) throw err; - message.channel.sendFile(buff); + return message.channel.sendFile(buff); }); } } diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index 1a082ff6..f87b789c 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -22,11 +22,11 @@ module.exports = class SteamCardCommand extends commando.Command { console.log(`[Command] ${message.content}`); if (message.channel.type !== 'dm') { if (message.mentions.users.size !== 1) { - let errorMes1 = await message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().avatarURL) { - let errorMes2 = await message.channel.send(":x: Error! This user has no avatar!"); + message.channel.send(":x: Error! This user has no avatar!"); } else { let userDisplayName = message.guild.member(message.mentions.users.first()).displayName; @@ -45,7 +45,7 @@ module.exports = class SteamCardCommand extends commando.Command { nothing.print(font, 38, 20, userDisplayName); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) throw err; - message.channel.sendFile(buff); + return message.channel.sendFile(buff); }); } } diff --git a/commands/botinfo/contact.js b/commands/botinfo/contact.js index a73c0fdd..5fc2b67e 100644 --- a/commands/botinfo/contact.js +++ b/commands/botinfo/contact.js @@ -26,15 +26,15 @@ module.exports = class ContactCommand extends commando.Command { let banID = message.author.id; let messageToReport = message.content.split(" ").slice(1).join(" "); if (message.author.id === banlist.banned[banID]) { - let banError = await message.channel.send("Sorry, you've been banned from using this command."); + message.channel.send("Sorry, you've been banned from using this command."); } else { if (!messageToReport) { - let blankError = await message.channel.send(':x: Error! Please do not report nothing!'); + message.channel.send(':x: Error! Please do not report nothing!'); } else { - let errorRepoty = await this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`); - let successMes = await message.channel.send('Message Sent! Thanks for your support!'); + this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`); + message.channel.send('Message Sent! Thanks for your support!'); } } } diff --git a/commands/botinfo/info.js b/commands/botinfo/info.js index bd785bf5..018f76ad 100644 --- a/commands/botinfo/info.js +++ b/commands/botinfo/info.js @@ -61,13 +61,13 @@ module.exports = class InfoCommand extends commando.Command { .addField('Utility Modules', "[superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/)") .addField('APIs', - "[Cleverbot API](https://www.cleverbot.com/api/), [Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api)") + "[Cleverbot API](https://www.cleverbot.com/api/), [Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/)") .addField('Other Credit', "[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)") .addField('My Server', "[Click Here to Join!](https://discord.gg/fqQF8mc)") .addField('Invite Link:', "[Click Here to Add Me to Your Server!](https://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343)"); - let embededMessage = await message.channel.sendEmbed(embed); + message.channel.sendEmbed(embed); } }; diff --git a/commands/botinfo/invite.js b/commands/botinfo/invite.js index 03584c7e..d92d0b9b 100644 --- a/commands/botinfo/invite.js +++ b/commands/botinfo/invite.js @@ -16,6 +16,6 @@ module.exports = class InviteCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - let inviteMes = await 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"); + 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"); } }; diff --git a/commands/botinfo/uptime.js b/commands/botinfo/uptime.js index af87b80c..bb5e7c28 100644 --- a/commands/botinfo/uptime.js +++ b/commands/botinfo/uptime.js @@ -18,6 +18,6 @@ module.exports = class UptimeCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - let uptimeMes = await 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 **${this.client.guilds.size} 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 **${this.client.guilds.size} Servers.**`); } }; diff --git a/commands/guildinfo/emoji.js b/commands/guildinfo/emoji.js index b6dbb87e..3cd560d1 100644 --- a/commands/guildinfo/emoji.js +++ b/commands/guildinfo/emoji.js @@ -22,10 +22,10 @@ module.exports = class EmojiCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.channel.type !== 'dm') { - let emojiMes = await message.channel.send(message.guild.emojis.map(e => e).join(" ")); + message.channel.send(message.guild.emojis.map(e => e).join(" ")); } else { - let errorMessage = await message.channel.send(":x: Error! This command does not work in DM!"); + message.channel.send(":x: Error! This command does not work in DM!"); } } }; diff --git a/commands/guildinfo/guildinfo.js b/commands/guildinfo/guildinfo.js index 735d7a0d..7c73d062 100644 --- a/commands/guildinfo/guildinfo.js +++ b/commands/guildinfo/guildinfo.js @@ -40,10 +40,10 @@ module.exports = class GuildInfoCommand extends commando.Command { `${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}`, true) .addField("**Users:**", message.guild.memberCount, true); - let embededMessage = await message.channel.sendEmbed(embed); + message.channel.sendEmbed(embed); } else { - let errorMessage = await message.channel.send(":x: Error! This command does not work in DM!"); + message.channel.send(":x: Error! This command does not work in DM!"); } } }; diff --git a/commands/imageedit/meme.js b/commands/imageedit/meme.js index 173c58d8..253cb619 100644 --- a/commands/imageedit/meme.js +++ b/commands/imageedit/meme.js @@ -119,7 +119,7 @@ module.exports = class MemeCommand extends commando.Command { console.log(`[Command] ${message.content}`); let [type] = message.content.toLowerCase().split(" ").slice(1); if (type === "list") { - let listMes = await message.channel.send("**Type Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen"); + let listMsg = await message.channel.send("**Type Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen"); } else if (message.content.includes(" | ")) { if (message.content.split(" ").slice(1).join(" ").match(/^[a-zA-Z0-9|.,!?'-\s]+$/)) { @@ -128,31 +128,31 @@ module.exports = class MemeCommand extends commando.Command { let bottomrow = memeQuery[1].split("?").join("~q"); let link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`; if (bottomrow.length > 100) { - let charErrMes1 = await message.channel.send(":x: Error! Bottom text is over 100 characters!"); + message.channel.send(":x: Error! Bottom text is over 100 characters!"); } else if (toprow.length > 100) { - let charErrMes2 = await message.channel.send(":x: Error! Top text is over 100 characters!"); + message.channel.send(":x: Error! Top text is over 100 characters!"); } else { if (memecodes[type]) { try { - let memeImg = await message.channel.sendFile(link); + message.channel.sendFile(link); } catch (err) { - let errorMessage = await message.channel.send(":x: An Error Occurred! Please try again later!"); + message.channel.send(":x: An Error Occurred! Please try again later!"); } } else { - let listErr = await message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!"); + message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!"); } } } else { - let regexErr = await message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!"); + message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!"); } } else { - let splitErr = await message.channel.send(":x: Split your two choices with a ' | '!"); + message.channel.send(":x: Split your two choices with a ' | '!"); } } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index cbead355..f229e039 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -14,6 +14,9 @@ module.exports = class BanCommand extends commando.Command { examples: [";ban @User being a jerk."] }); } + hasPermission(msg) { + return msg.author.hasPermission('BAN_MEMBERS'); + } async run(message) { if (message.channel.type !== 'dm') { @@ -24,37 +27,32 @@ module.exports = class BanCommand extends commando.Command { let userToBan = message.mentions.users.first(); let reason = message.content.split(" ").slice(2).join(" "); if (message.mentions.users.size !== 1) { - let mentionError = await message.channel.send(":x: Error! Please mention one user!"); + message.channel.send(":x: Error! Please mention one user!"); } else { - if (message.member.hasPermission('BAN_MEMBERS')) { - if (message.guild.member(userToBan).bannable) { - let okHandMes = await message.channel.send(":ok_hand:"); - let banMember = await 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:** ${userToBan.username}#${userToBan.discriminator} (${userToBan.id})\n**Action:** Ban\n**Reason:** ${reason}`); - let modLog = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); - } - else { - let modLogNote = await 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.**"); - } + if (message.guild.member(userToBan).bannable) { + message.channel.send(":ok_hand:"); + 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:** ${userToBan.username}#${userToBan.discriminator} (${userToBan.id})\n**Action:** Ban\n**Reason:** ${reason}`); + message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } else { - let banErr = await message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?"); + 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 { - let permissionErr = await message.channel.send(":x: Error! You don't have the Ban Members Permission!"); + message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?"); } } } else { - let dmErr = await message.channel.send(":x: Error! This command does not work in DM!"); + message.channel.send(":x: Error! This command does not work in DM!"); } } }; diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 0616449c..087b40e7 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -11,6 +11,9 @@ module.exports = class KickCommand extends commando.Command { examples: [";kick @User being a jerk."] }); } + hasPermission(msg) { + return msg.author.hasPermission('KICK_MEMBERS'); + } async run(message) { if (message.channel.type !== 'dm') { @@ -21,37 +24,32 @@ module.exports = class KickCommand extends commando.Command { let userToKick = message.mentions.users.first(); let reason = message.content.split(" ").slice(2).join(" "); if (message.mentions.users.size !== 1) { - let mentionError = await message.channel.send(":x: Error! Please mention one user!"); + message.channel.send(":x: Error! Please mention one user!"); } else { - if (message.member.hasPermission('KICK_MEMBERS')) { - if (message.guild.member(userToKick).kickable) { - let okHandMes = await message.channel.send(":ok_hand:"); - let kickMember = await 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:** ${userToKick.username}#${userToKick.discriminator} (${userToKick.id})\n**Action:** Kick\n**Reason:** ${reason}`); - let modLog = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); - } - else { - let modLogNote = await 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.**"); - } + if (message.guild.member(userToKick).kickable) { + message.channel.send(":ok_hand:"); + 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:** ${userToKick.username}#${userToKick.discriminator} (${userToKick.id})\n**Action:** Kick\n**Reason:** ${reason}`); + message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } else { - let kickErr = await message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?"); + 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 { - let permissionErr = await message.channel.send(":x: Error! You don't have the Kick Members Permission!"); + message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?"); } } } else { - let dmErr = await message.channel.send(":x: Error! This command does not work in DM!"); + message.channel.send(":x: Error! This command does not work in DM!"); } } }; diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 36258eff..21cd8e34 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -11,6 +11,9 @@ module.exports = class WarnCommand extends commando.Command { examples: [";warn @User being a jerk."] }); } + hasPermission(msg) { + return msg.author.hasPermission('MANAGE_MESSAGES'); + } async run(message) { if (message.channel.type !== 'dm') { @@ -21,31 +24,26 @@ module.exports = class WarnCommand extends commando.Command { let userToWarn = message.mentions.users.first(); let reason = message.content.split(" ").slice(2).join(" "); if (message.mentions.users.size !== 1) { - let mentionError = await message.channel.send(":x: Error! Please mention one user!"); + message.channel.send(":x: Error! Please mention one user!"); } else { - if (message.member.hasPermission('MANAGE_MESSAGES')) { - let okHandMes = await message.channel.send(":ok_hand:"); - if (message.guild.channels.exists("name", "mod_logs")) { - const embed = new Discord.RichEmbed() - .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) - .setColor(0xFFFF00) - .setFooter('XiaoBot Moderation', this.client.user.avatarURL) - .setTimestamp() - .setDescription(`**Member:** ${userToWarn.username}#${userToWarn.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`); - let modLog = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); - } - else { - let modLogNote = await 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(":ok_hand:"); + if (message.guild.channels.exists("name", "mod_logs")) { + const embed = new Discord.RichEmbed() + .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) + .setColor(0xFFFF00) + .setFooter('XiaoBot Moderation', this.client.user.avatarURL) + .setTimestamp() + .setDescription(`**Member:** ${userToWarn.username}#${userToWarn.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`); + message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } else { - let permissionErr = await message.channel.send(":x: Error! You don't have the Manage Messages Permission!"); + 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 { - let dmErr = await message.channel.send(":x: Error! This command does not work in DM!"); + message.channel.send(":x: Error! This command does not work in DM!"); } } }; diff --git a/commands/numedit/math.js b/commands/numedit/math.js index 25eba884..fdf0fd9c 100644 --- a/commands/numedit/math.js +++ b/commands/numedit/math.js @@ -27,14 +27,14 @@ module.exports = class MathCommand extends commando.Command { try { let solved = math.eval(expression); try { - let solvedMes = await message.channel.send(solved); + message.channel.send(solved); } catch (err) { - let invalidErr1 = await message.channel.send(":x: Error! Invalid statement!"); + message.channel.send(":x: Error! Invalid statement!"); } } catch (err) { - let invalidErr2 = await message.channel.send(":x: Error! Invalid statement!"); + message.channel.send(":x: Error! Invalid statement!"); } } }; diff --git a/commands/numedit/roman.js b/commands/numedit/roman.js index 7bcbdfa9..931b3a98 100644 --- a/commands/numedit/roman.js +++ b/commands/numedit/roman.js @@ -20,14 +20,14 @@ module.exports = class RomanCommand extends commando.Command { let numberToRoman = message.content.split(" ").slice(1).join(" "); let romanInterger = Number(numberToRoman); if (romanInterger > 1000000) { - let numberErr = await message.channel.send(':x: Error! Number is too high!'); + message.channel.send(':x: Error! Number is too high!'); } else { try { - let romanMes = await message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger)); + message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger)); } catch (err) { - let errMes = await message.channel.send(':x: Error! Something went wrong! Perhaps you entered nothing?'); + message.channel.send(':x: Error! Something went wrong! Perhaps you entered nothing?'); } } } diff --git a/commands/random/canyounot.js b/commands/random/canyounot.js index b132cbb0..6a093fdd 100644 --- a/commands/random/canyounot.js +++ b/commands/random/canyounot.js @@ -16,6 +16,6 @@ module.exports = class CanYouNot extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - return message.channel.send('Can YOU not?'); + message.channel.send('Can YOU not?'); } }; diff --git a/commands/random/giveflower.js b/commands/random/giveflower.js index e9e0c18c..f33faf58 100644 --- a/commands/random/giveflower.js +++ b/commands/random/giveflower.js @@ -20,6 +20,6 @@ module.exports = class GiveFlowerCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - return message.channel.send('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪'); + message.channel.send('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪'); } }; diff --git a/commands/random/lenny.js b/commands/random/lenny.js index b2e45c05..8207c7d9 100644 --- a/commands/random/lenny.js +++ b/commands/random/lenny.js @@ -16,6 +16,6 @@ module.exports = class LennyCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - return message.channel.send('( ͡° ͜ʖ ͡°)'); + message.channel.send('( ͡° ͜ʖ ͡°)'); } }; diff --git a/commands/random/lottery.js b/commands/random/lottery.js index d45706db..50dea50b 100644 --- a/commands/random/lottery.js +++ b/commands/random/lottery.js @@ -18,10 +18,10 @@ module.exports = class LotteryCommand extends commando.Command { console.log(`[Command] ${message.content}`); let lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)]; if (lotteryNumber === "Winner") { - return message.channel.send(`Wow ${message.author.username}! You actually won! Great job!`); + message.channel.send(`Wow ${message.author.username}! You actually won! Great job!`); } else { - return message.channel.send(`Nope, sorry ${message.author.username}, you lost.`); + message.channel.send(`Nope, sorry ${message.author.username}, you lost.`); } } }; diff --git a/commands/random/mathgame.js b/commands/random/mathgame.js index a0faa140..2ebfaa9d 100644 --- a/commands/random/mathgame.js +++ b/commands/random/mathgame.js @@ -41,23 +41,24 @@ module.exports = class MathGameCommand extends commando.Command { let randomExpression = randomValue1 + randomType + randomValue2; let solved = math.eval(randomExpression); if (!randomValue) { - return message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)'); + message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)'); } else { const embed = new Discord.RichEmbed() .setTitle('You have **ten** seconds to answer:') .setDescription(randomExpression); - await message.channel.sendEmbed(embed).then(() => { - message.channel.awaitMessages(response => response.content === solved.toString() && response.author.id === message.author.id, { + let embedMsg = await message.channel.sendEmbed(embed); + try { + let collected = await message.channel.awaitMessages(response => response.content === solved.toString() && response.author.id === message.author.id, { max: 1, time: 10000, errors: ['time'], - }).then((collected) => { - return message.channel.send(`Good Job! You won!`); - }).catch(() => { - return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${solved}`); }); - }); + message.channel.send(`Good Job! You won! ${collected} is the correct answer!`); + } + catch (err) { + message.channel.send(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); + } } } }; diff --git a/commands/random/nitro.js b/commands/random/nitro.js index 5d973e14..81ab5395 100644 --- a/commands/random/nitro.js +++ b/commands/random/nitro.js @@ -23,6 +23,6 @@ module.exports = class NitroCommand extends commando.Command { .setColor(0x748BD9) .setURL("https://discordapp.com/nitro") .setDescription("This Message can only be viewed by members with Discord Nitro.\n\n\n[More Information](https://discordapp.com/nitro)"); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed); } }; diff --git a/commands/random/quiz.js b/commands/random/quiz.js index f89cd904..c52e029e 100644 --- a/commands/random/quiz.js +++ b/commands/random/quiz.js @@ -30,21 +30,21 @@ module.exports = class QuizCommand extends commando.Command { const embed = new Discord.RichEmbed() .setTitle('You have **fifteen** seconds to answer this question:') .setDescription(`**Category: ${response.body[0].category.title}**\n${response.body[0].question}`); - let embededMessage = await message.channel.sendEmbed(embed); + let embedMsg = await message.channel.sendEmbed(embed); try { let collected = await message.channel.awaitMessages(res => res.content.toLowerCase() === response.body[0].answer.toLowerCase() && res.author.id === message.author.id, { max: 1, time: 15000, errors: ['time'] }); - let winnerMes = await message.channel.send(`Good Job! You won!`); + message.channel.send(`Good Job! You won! ${collected} is the correct answer!`); } catch (err) { - let loserMes = await message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body[0].answer}`); + message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body[0].answer}`); } } catch (err) { - let errorMessage = await message.channel.send(":x: Error! Something went wrong!"); + message.channel.send(":x: Error! Something went wrong!"); } } }; diff --git a/commands/random/slowclap.js b/commands/random/slowclap.js index 0be8e6d5..64c1553d 100644 --- a/commands/random/slowclap.js +++ b/commands/random/slowclap.js @@ -16,6 +16,6 @@ module.exports = class SlowClapCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - return message.channel.send('*slow clap*'); + message.channel.send('*slow clap*'); } }; diff --git a/commands/random/soundboard.js b/commands/random/soundboard.js index bc9a85ea..ac1d6fdf 100644 --- a/commands/random/soundboard.js +++ b/commands/random/soundboard.js @@ -23,51 +23,50 @@ module.exports = class SoundBoardCommand extends commando.Command { console.log(`[Command] ${message.content}`); if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['CONNECT', 'SPEAK', 'ADD_REACTIONS'])) { - return message.channel.send(':x: Error! In order to do this command, you must give me the permissions to "Connect" and "Speak", as well as the permission to Add Reactions!'); + message.channel.send(':x: Error! In order to do this command, you must give me the permissions to "Connect" and "Speak", as well as the permission to Add Reactions!'); } else { let voiceChannel = message.member.voiceChannel; if (!voiceChannel) { - return message.channel.send(`:x: Error! Please be in a voice channel first!`); + message.channel.send(`:x: Error! Please be in a voice channel first!`); } else { let soundToPlay = message.content.toLowerCase().split(" ").slice(1).join(" "); if (!soundToPlay) { - return message.channel.send(':x: Error! No sound set. Please use ;soundboard list to see a list of sounds you can play.'); + message.channel.send(':x: Error! No sound set. Please use ;soundboard list to see a list of sounds you can play.'); } else if (soundToPlay === 'list') { - return message.channel.send("**Available Sounds:** Cat, Pikachu, Vader, Doh, It's a Trap, Mario Death, Pokemon Center, Dun Dun Dun, Spongebob, Ugly Barnacle, Woo Hoo, Space, GLaDOS Bird, Airhorn, Zelda Chest, Eat my Shorts, No This is Patrick, Wumbo"); + message.channel.send("**Available Sounds:** Cat, Pikachu, Vader, Doh, It's a Trap, Mario Death, Pokemon Center, Dun Dun Dun, Spongebob, Ugly Barnacle, Woo Hoo, Space, GLaDOS Bird, Airhorn, Zelda Chest, Eat my Shorts, No This is Patrick, Wumbo"); } else if (soundToPlay === sounds.avaliable[soundToPlay]) { let alreadyConnected = await this.client.voiceConnections.get(voiceChannel.guild.id); if (alreadyConnected) { if (alreadyConnected.channel.id === voiceChannel.id) { - return message.channel.send(':x: Error! I am already playing a sound!'); + message.channel.send(':x: Error! I am already playing a sound!'); } else { - return message.channel.send(':x: Error! I am already playing a sound!'); + message.channel.send(':x: Error! I am already playing a sound!'); } } else { - await voiceChannel.join().then(connection => { - let stream = sounds.paths[soundToPlay]; - let dispatcher = connection.playStream(stream); - message.react('🔊'); - dispatcher.on('end', () => { - message.react('✅'); - return voiceChannel.leave(); - }); + let connection = await voiceChannel.join(); + let stream = sounds.paths[soundToPlay]; + let dispatcher = connection.playStream(stream); + message.react('🔊'); + dispatcher.on('end', () => { + message.react('✅'); + return voiceChannel.leave(); }); } } else { - return message.channel.send(':x: Error! Sound not found! 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 { - return message.channel.send(':x: This is a DM!'); + message.channel.send(':x: This is a DM!'); } } }; diff --git a/commands/random/spam.js b/commands/random/spam.js index 84b87ae7..f31397f6 100644 --- a/commands/random/spam.js +++ b/commands/random/spam.js @@ -16,6 +16,6 @@ module.exports = class SpamCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; } console.log(`[Command] ${message.content}`); - return message.channel.sendFile("./images/Spam.jpg"); + message.channel.sendFile("./images/Spam.jpg"); } }; diff --git a/commands/random/today.js b/commands/random/today.js index d612491d..7ed96044 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -21,26 +21,27 @@ module.exports = class TodayCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; } console.log("[Command] " + message.content); - return request - .get('http://history.muffinlabs.com/date') - .set({ - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }) - .buffer(true) - .then(function(response) { - let responseData = JSON.parse(response.text); - let randomNumber = Math.floor(Math.random() * responseData.data.Events.length); - const embed = new Discord.RichEmbed() - .setColor(0x9797FF) - .setURL(responseData.url) - .setTitle('On this day (' + responseData.date + ')...') - .setTimestamp() - .setDescription(responseData.data.Events[randomNumber].text + ' (' + responseData.data.Events[randomNumber].year + ')'); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! Something went wrong!"); - }); + try { + let response = await request + .get('http://history.muffinlabs.com/date') + .set({ + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }) + .buffer(true); + let responseData = JSON.parse(response.text); + let randomNumber = Math.floor(Math.random() * responseData.data.Events.length); + const embed = new Discord.RichEmbed() + .setColor(0x9797FF) + .setURL(responseData.url) + .setTitle('On this day (' + responseData.date + ')...') + .setTimestamp() + .setDescription(responseData.data.Events[randomNumber].text + ' (' + responseData.data.Events[randomNumber].year + ')'); + message.channel.sendEmbed(embed); + } + catch (err) { + console.log(err); + message.channel.send(":x: Error! Something went wrong!"); + } } }; diff --git a/commands/random/typinggame.js b/commands/random/typinggame.js index 5d647c26..279b4023 100644 --- a/commands/random/typinggame.js +++ b/commands/random/typinggame.js @@ -51,23 +51,24 @@ module.exports = class TypingGameCommand extends commando.Command { break; } if (!time) { - return message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)'); + message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)'); } else { const embed = new Discord.RichEmbed() .setTitle(`You have **${levelWord}** seconds to type:`) .setDescription(randomSentence); - await message.channel.sendEmbed(embed).then(() => { - message.channel.awaitMessages(response => response.content === randomSentence && response.author.id === message.author.id, { + let embedMsg = await message.channel.sendEmbed(embed); + try { + let collected = await message.channel.awaitMessages(response => response.content === randomSentence && response.author.id === message.author.id, { max: 1, time: time, - errors: ['time'], - }).then((collected) => { - return message.channel.send(`Good Job! You won!`); - }).catch(() => { - return message.channel.send('Aw... Too bad, try again next time!'); + errors: ['time'] }); - }); + message.channel.send(`Good Job! You won!\n${collected} was typed fast enough!`); + } + catch (err) { + message.channel.send('Aw... Too bad, try again next time!'); + } } } }; diff --git a/commands/response/8ball.js b/commands/response/8ball.js index 70b0ba36..c86aeb13 100644 --- a/commands/response/8ball.js +++ b/commands/response/8ball.js @@ -22,6 +22,6 @@ module.exports = class MagicBall extends commando.Command { if (!question) { question = "Not Specified."; } - return message.channel.send(`Question: ${question}\n:8ball: ${answers} :8ball:`); + message.channel.send(`Question: ${question}\n:8ball: ${answers} :8ball:`); } }; diff --git a/commands/response/cat.js b/commands/response/cat.js index a4f23ea9..e4fe30c6 100644 --- a/commands/response/cat.js +++ b/commands/response/cat.js @@ -18,6 +18,6 @@ module.exports = class RandomCat extends commando.Command { 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"]; cat = cat[Math.floor(Math.random() * cat.length)]; - return message.channel.sendFile(`./images/Cat${cat}`); + message.channel.sendFile(`./images/Cat${cat}`); } }; diff --git a/commands/response/choose.js b/commands/response/choose.js index 78b16291..2d04e80f 100644 --- a/commands/response/choose.js +++ b/commands/response/choose.js @@ -22,10 +22,10 @@ module.exports = class ChooseCommand extends commando.Command { if (message.content.includes(" | ")) { let choices = message.content.split(" ").slice(1).join(" ").split(' | '); choices = choices[Math.floor(Math.random() * choices.length)]; - return message.channel.send(`I choose ${choices}!`); + message.channel.send(`I choose ${choices}!`); } else { - return message.channel.send(":x: Split your two choices with a ' | '!"); + message.channel.send(":x: Split your two choices with a ' | '!"); } } }; diff --git a/commands/response/coin.js b/commands/response/coin.js index 3c1fe76e..29255a44 100644 --- a/commands/response/coin.js +++ b/commands/response/coin.js @@ -22,6 +22,6 @@ module.exports = class CoinFlipCommand extends commando.Command { console.log(`[Command] ${message.content}`); let coin = ['Heads', 'Tails']; coin = coin[Math.floor(Math.random() * coin.length)]; - return message.channel.send(`It landed on ${coin}`); + message.channel.send(`It landed on ${coin}`); } }; diff --git a/commands/response/compliment.js b/commands/response/compliment.js index 57955614..bf7657d3 100644 --- a/commands/response/compliment.js +++ b/commands/response/compliment.js @@ -20,10 +20,10 @@ module.exports = class ComplimentCommand extends commando.Command { 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) { - return message.reply(compliments); + message.reply(compliments); } else { - return message.channel.send(`${thingToCompliment}, ${compliments}`); + message.channel.send(`${thingToCompliment}, ${compliments}`); } } }; diff --git a/commands/response/factcore.js b/commands/response/factcore.js index 0347e243..2b31602f 100644 --- a/commands/response/factcore.js +++ b/commands/response/factcore.js @@ -18,6 +18,6 @@ module.exports = class FactCore extends commando.Command { console.log(`[Command] ${message.content}`); 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)]; - return message.channel.send(facts); + message.channel.send(facts); } }; diff --git a/commands/response/fishy.js b/commands/response/fishy.js index e1abae2d..ad2156a2 100644 --- a/commands/response/fishy.js +++ b/commands/response/fishy.js @@ -22,6 +22,6 @@ module.exports = class FishyCommand extends commando.Command { console.log(`[Command] ${message.content}`); let fish = [':fish:', ':tropical_fish:', ':blowfish:']; fish = fish[Math.floor(Math.random() * fish.length)]; - return message.channel.send(`You caught a: ${fish}`); + message.channel.send(`You caught a: ${fish}`); } }; diff --git a/commands/response/fortune.js b/commands/response/fortune.js index 54354638..8bec1588 100644 --- a/commands/response/fortune.js +++ b/commands/response/fortune.js @@ -21,6 +21,6 @@ module.exports = class FortuneCookieCommand extends commando.Command { 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)]; - return message.channel.send(fortunes); + message.channel.send(fortunes); } }; diff --git a/commands/response/motivate.js b/commands/response/motivate.js index 09014952..fcc3e22f 100644 --- a/commands/response/motivate.js +++ b/commands/response/motivate.js @@ -22,10 +22,10 @@ module.exports = class MotivateCommand extends commando.Command { console.log(`[Command] ${message.content}`); let userToMotivate = message.content.split(" ").slice(1).join(" "); if (!userToMotivate) { - return message.reply('https://www.youtube.com/watch?v=ZXsQAXx_ao0'); + message.reply('https://www.youtube.com/watch?v=ZXsQAXx_ao0'); } else { - return message.channel.send(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`); + message.channel.send(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`); } } }; diff --git a/commands/response/name.js b/commands/response/name.js index 443159b7..2e66473b 100644 --- a/commands/response/name.js +++ b/commands/response/name.js @@ -29,13 +29,13 @@ module.exports = class RandomNameGen extends commando.Command { let randomFirstBoth = [randomFirstMale, randomFirstFemale]; randomFirstBoth = randomFirstBoth[Math.floor(Math.random() * randomFirstBoth.length)]; if (message.content.toLowerCase().split(" ").slice(1).includes("male")) { - return message.channel.send(`${randomFirstMale} ${randomLast}`); + message.channel.send(`${randomFirstMale} ${randomLast}`); } else if (message.content.toLowerCase().split(" ").slice(1).includes("female")) { - return message.channel.send(`${randomFirstFemale} ${randomLast}`); + message.channel.send(`${randomFirstFemale} ${randomLast}`); } else { - return message.channel.send(`${randomFirstBoth} ${randomLast}`); + message.channel.send(`${randomFirstBoth} ${randomLast}`); } } }; diff --git a/commands/response/offspring.js b/commands/response/offspring.js index 8f796497..ea1dd948 100644 --- a/commands/response/offspring.js +++ b/commands/response/offspring.js @@ -6,8 +6,7 @@ module.exports = class OffspringCommand extends commando.Command { name: 'offspring', aliases: [ 'child', - 'baby', - 'sex' + 'baby' ], group: 'response', memberName: 'offspring', @@ -23,6 +22,6 @@ module.exports = class OffspringCommand extends commando.Command { console.log(`[Command] ${message.content}`); let gender = ['boy', 'girl']; gender = gender[Math.floor(Math.random() * gender.length)]; - return message.channel.send(`It's a ${gender}!`); + message.channel.send(`It's a ${gender}!`); } }; diff --git a/commands/response/potato.js b/commands/response/potato.js index d04e99a1..4e30260a 100644 --- a/commands/response/potato.js +++ b/commands/response/potato.js @@ -18,6 +18,6 @@ module.exports = class PotatoCommand extends commando.Command { 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)]; - return message.channel.sendFile(`./images/Potato${potato}`); + message.channel.sendFile(`./images/Potato${potato}`); } }; diff --git a/commands/response/pun.js b/commands/response/pun.js index d62d6c45..280d9fff 100644 --- a/commands/response/pun.js +++ b/commands/response/pun.js @@ -18,6 +18,6 @@ module.exports = class RandomPun extends commando.Command { 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)]; - return message.channel.sendFile(`./images/${pun}`); + message.channel.sendFile(`./images/${pun}`); } }; diff --git a/commands/response/quantumcoin.js b/commands/response/quantumcoin.js index 7d842fef..4cb82f46 100644 --- a/commands/response/quantumcoin.js +++ b/commands/response/quantumcoin.js @@ -23,6 +23,6 @@ module.exports = class QuantumCoin extends commando.Command { 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)]; - return message.channel.send(`It landed ${qcoin}`); + message.channel.send(`It landed ${qcoin}`); } }; diff --git a/commands/response/ratewaifu.js b/commands/response/ratewaifu.js index 494ab371..2d311262 100644 --- a/commands/response/ratewaifu.js +++ b/commands/response/ratewaifu.js @@ -21,6 +21,6 @@ module.exports = class RateWaifuCommand extends commando.Command { console.log(`[Command] ${message.content}`); let waifuToRate = message.content.split(" ").slice(1).join(" "); let rating = Math.floor(Math.random() * 10) + 1; - return message.channel.send(`I'd give ${waifuToRate} a ${rating}/10!`); + message.channel.send(`I'd give ${waifuToRate} a ${rating}/10!`); } }; diff --git a/commands/response/roast.js b/commands/response/roast.js index f3b3104e..e90199b7 100644 --- a/commands/response/roast.js +++ b/commands/response/roast.js @@ -23,10 +23,10 @@ module.exports = class RoastMeCommand extends commando.Command { 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) { - return message.reply(roasts); + message.reply(roasts); } else { - return message.channel.send(`${userToRoast}, ${roasts}`); + message.channel.send(`${userToRoast}, ${roasts}`); } } }; diff --git a/commands/response/rockpaperscissors.js b/commands/response/rockpaperscissors.js index 703f02d3..fcedb191 100644 --- a/commands/response/rockpaperscissors.js +++ b/commands/response/rockpaperscissors.js @@ -23,43 +23,43 @@ module.exports = class RockPaperScissors extends commando.Command { let response = ['Paper', 'Rock', 'Scissors']; response = response[Math.floor(Math.random() * response.length)]; if (!rps) { - return message.channel.send(":x: Error! Your message contains nothing!"); + message.channel.send(":x: Error! Your message contains nothing!"); } else if (rps.includes("rock")) { if (response === "Rock") { - return message.channel.send("Rock! Aw, it's a tie!"); + message.channel.send("Rock! Aw, it's a tie!"); } if (response === "Paper") { - return message.channel.send("Paper! Yes! I win!"); + message.channel.send("Paper! Yes! I win!"); } if (response === "Scissors") { - return message.channel.send("Scissors! Aw... I lose..."); + message.channel.send("Scissors! Aw... I lose..."); } } else if (rps.includes("paper")) { if (response === "Rock") { - return message.channel.send("Rock! Aw... I lose..."); + message.channel.send("Rock! Aw... I lose..."); } if (response === "Paper") { - return message.channel.send("Paper! Aw, it's a tie!"); + message.channel.send("Paper! Aw, it's a tie!"); } if (response === "Scissors") { - return message.channel.send("Scissors! Yes! I win!"); + message.channel.send("Scissors! Yes! I win!"); } } else if (rps.includes("scissors")) { if (response === "Rock") { - return message.channel.send("Rock! Yes! I win!"); + message.channel.send("Rock! Yes! I win!"); } if (response === "Paper") { - return message.channel.send("Paper! Aw... I lose..."); + message.channel.send("Paper! Aw... I lose..."); } if (response === "Scissors") { - return message.channel.send("Scissors! Aw, it's a tie!"); + message.channel.send("Scissors! Aw, it's a tie!"); } } else { - return message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!"); + message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!"); } } }; diff --git a/commands/response/roll.js b/commands/response/roll.js index 2d087880..7a7b4144 100644 --- a/commands/response/roll.js +++ b/commands/response/roll.js @@ -23,14 +23,14 @@ module.exports = class RollChooseCommand extends commando.Command { let [value] = message.content.split(" ").slice(1); if (!value) { let roll = Math.floor(Math.random() * 6) + 1; - return 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; - return message.channel.send(`You rolled a ${roll}`); + message.channel.send(`You rolled a ${roll}`); } else { - return 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)"); + 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)"); } } }; diff --git a/commands/response/roulette.js b/commands/response/roulette.js index 8c30c4d0..5f49672e 100644 --- a/commands/response/roulette.js +++ b/commands/response/roulette.js @@ -23,10 +23,10 @@ module.exports = class RouletteCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.channel.type !== 'dm') { - return message.channel.send(`I choose ${message.guild.members.random().displayName}!`); + message.channel.send(`I choose ${message.guild.members.random().displayName}!`); } else { - return message.channel.send(':x: Error! This command does not work in DM!'); + message.channel.send(':x: Error! This command does not work in DM!'); } } }; diff --git a/commands/response/ship.js b/commands/response/ship.js index 74a2ba44..cbdae7fa 100644 --- a/commands/response/ship.js +++ b/commands/response/ship.js @@ -21,6 +21,6 @@ module.exports = class ShipCommand extends commando.Command { console.log(`[Command] ${message.content}`); let thingToShip = message.content.split(" ").slice(1).join(" "); let percentage = Math.floor(Math.random() * 100) + 1; - return message.channel.send(`I'd give ${thingToShip} a ${percentage}%!`); + message.channel.send(`I'd give ${thingToShip} a ${percentage}%!`); } }; diff --git a/commands/response/slots.js b/commands/response/slots.js index effe75ff..6fdd1236 100644 --- a/commands/response/slots.js +++ b/commands/response/slots.js @@ -22,10 +22,10 @@ module.exports = class SlotsCommand extends commando.Command { let slotThree = slotThing[Math.floor(Math.random() * slotThing.length)]; let slotFour = slotThing[Math.floor(Math.random() * slotThing.length)]; if (slotOne === slotTwo && slotOne === slotThree && slotOne === slotFour) { - return message.channel.send(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nWow! You won! Great job... er... luck!`); + message.channel.send(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nWow! You won! Great job... er... luck!`); } else { - return message.channel.send(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nAww... You lost... Guess it's just bad luck, huh?`); + message.channel.send(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nAww... You lost... Guess it's just bad luck, huh?`); } } }; diff --git a/commands/response/vocaloid.js b/commands/response/vocaloid.js index 8f7b6b78..f64eccb4 100644 --- a/commands/response/vocaloid.js +++ b/commands/response/vocaloid.js @@ -21,6 +21,6 @@ module.exports = class VocaloidSongRndm extends commando.Command { console.log(`[Command] ${message.content}`); 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)]; - return message.channel.send(songs); + message.channel.send(songs); } }; diff --git a/commands/response/xiaopai.js b/commands/response/xiaopai.js index 8f76c0c6..a903d7fd 100644 --- a/commands/response/xiaopai.js +++ b/commands/response/xiaopai.js @@ -21,6 +21,6 @@ module.exports = class RandomXiaoPai extends commando.Command { 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)]; - return message.channel.sendFile(`./images/Xiao${XiaoPai}`); + message.channel.sendFile(`./images/Xiao${XiaoPai}`); } }; diff --git a/commands/roleplay/cuddle.js b/commands/roleplay/cuddle.js index 8d52757b..6313a514 100644 --- a/commands/roleplay/cuddle.js +++ b/commands/roleplay/cuddle.js @@ -17,6 +17,6 @@ module.exports = class CuddleCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *cuddles* ${thingToRoleplay}`); + message.channel.send(`${message.author} *cuddles* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/divorce.js b/commands/roleplay/divorce.js index 046375dc..aaadf33b 100644 --- a/commands/roleplay/divorce.js +++ b/commands/roleplay/divorce.js @@ -17,6 +17,6 @@ module.exports = class DivorceCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *divorces* ${thingToRoleplay}`); + message.channel.send(`${message.author} *divorces* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/eat.js b/commands/roleplay/eat.js index c29a46c3..bf9d6565 100644 --- a/commands/roleplay/eat.js +++ b/commands/roleplay/eat.js @@ -17,6 +17,6 @@ module.exports = class EatCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *eats* ${thingToRoleplay}`); + message.channel.send(`${message.author} *eats* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/falconpunch.js b/commands/roleplay/falconpunch.js index 1483517e..bfac4b74 100644 --- a/commands/roleplay/falconpunch.js +++ b/commands/roleplay/falconpunch.js @@ -17,6 +17,6 @@ module.exports = class FalconPunchCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *falcon punches* ${thingToRoleplay}`); + message.channel.send(`${message.author} *falcon punches* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/fistbump.js b/commands/roleplay/fistbump.js index ffe5e9b5..602b9b98 100644 --- a/commands/roleplay/fistbump.js +++ b/commands/roleplay/fistbump.js @@ -17,6 +17,6 @@ module.exports = class FistBumpCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *fist-bumps* ${thingToRoleplay} *badalalala*`); + message.channel.send(`${message.author} *fist-bumps* ${thingToRoleplay} *badalalala*`); } }; diff --git a/commands/roleplay/highfive.js b/commands/roleplay/highfive.js index a13d7461..638198a3 100644 --- a/commands/roleplay/highfive.js +++ b/commands/roleplay/highfive.js @@ -17,6 +17,6 @@ module.exports = class HighFivesCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *high-fives* ${thingToRoleplay}`); + message.channel.send(`${message.author} *high-fives* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/hitwithshovel.js b/commands/roleplay/hitwithshovel.js index 559d0155..80eebeb7 100644 --- a/commands/roleplay/hitwithshovel.js +++ b/commands/roleplay/hitwithshovel.js @@ -17,6 +17,6 @@ module.exports = class HitwithShovelCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *hits* ${thingToRoleplay} *with a shovel*`); + message.channel.send(`${message.author} *hits* ${thingToRoleplay} *with a shovel*`); } }; diff --git a/commands/roleplay/hug.js b/commands/roleplay/hug.js index e37b95ec..7b01179a 100644 --- a/commands/roleplay/hug.js +++ b/commands/roleplay/hug.js @@ -17,6 +17,6 @@ module.exports = class HugCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *hugs* ${thingToRoleplay}`); + message.channel.send(`${message.author} *hugs* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/inhales.js b/commands/roleplay/inhales.js index 647fce4e..5bcef823 100644 --- a/commands/roleplay/inhales.js +++ b/commands/roleplay/inhales.js @@ -17,6 +17,6 @@ module.exports = class InhaleCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *inhales* ${thingToRoleplay} *but gained no ability...*`); + message.channel.send(`${message.author} *inhales* ${thingToRoleplay} *but gained no ability...*`); } }; diff --git a/commands/roleplay/kill.js b/commands/roleplay/kill.js index 4afeb6c0..9d71bdaa 100644 --- a/commands/roleplay/kill.js +++ b/commands/roleplay/kill.js @@ -17,6 +17,6 @@ module.exports = class KillCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *kills* ${thingToRoleplay}`); + message.channel.send(`${message.author} *kills* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/kiss.js b/commands/roleplay/kiss.js index eb098af9..9f57c837 100644 --- a/commands/roleplay/kiss.js +++ b/commands/roleplay/kiss.js @@ -17,6 +17,6 @@ module.exports = class KissCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *kisses* ${thingToRoleplay}`); + message.channel.send(`${message.author} *kisses* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/marries.js b/commands/roleplay/marries.js index ff6dd2e7..f757a9a2 100644 --- a/commands/roleplay/marries.js +++ b/commands/roleplay/marries.js @@ -17,6 +17,6 @@ module.exports = class MarryCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *marries* ${thingToRoleplay}`); + message.channel.send(`${message.author} *marries* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/pat.js b/commands/roleplay/pat.js index a435d719..c151a661 100644 --- a/commands/roleplay/pat.js +++ b/commands/roleplay/pat.js @@ -17,6 +17,6 @@ module.exports = class PatCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *pats* ${thingToRoleplay}`); + message.channel.send(`${message.author} *pats* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/poke.js b/commands/roleplay/poke.js index ecbf3d7a..a94a9b8f 100644 --- a/commands/roleplay/poke.js +++ b/commands/roleplay/poke.js @@ -17,6 +17,6 @@ module.exports = class PokeCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *pokes* ${thingToRoleplay}`); + message.channel.send(`${message.author} *pokes* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/punch.js b/commands/roleplay/punch.js index 075fb2c9..70dda67e 100644 --- a/commands/roleplay/punch.js +++ b/commands/roleplay/punch.js @@ -17,6 +17,6 @@ module.exports = class PunchCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *punches* ${thingToRoleplay}`); + message.channel.send(`${message.author} *punches* ${thingToRoleplay}`); } }; diff --git a/commands/roleplay/slap.js b/commands/roleplay/slap.js index 9528aa8d..490fa332 100644 --- a/commands/roleplay/slap.js +++ b/commands/roleplay/slap.js @@ -17,6 +17,6 @@ module.exports = class SlapCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToRoleplay = message.content.split(" ").slice(1).join(" "); - return message.channel.send(`${message.author} *slaps* ${thingToRoleplay}`); + message.channel.send(`${message.author} *slaps* ${thingToRoleplay}`); } }; diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index e9398dff..54e789b1 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -25,32 +25,32 @@ module.exports = class BotSearchCommand extends commando.Command { console.log(`[Command] ${message.content}`); if (message.mentions.users.size === 1) { let botToFind = message.mentions.users.first().id; - return 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.body.name) - .setURL('https://bots.discord.pw/') - .setDescription(response.body.description) - .addField('**Library:**', - response.body.library, true) - .addField('**Prefix:**', - response.body.prefix, true) - .addField('**Invite:**', - `[Here](${response.body.invite_url})`, true); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! Bot not Found!"); - }); + try { + let response = await request + .get(`https://bots.discord.pw/api/bots/${botToFind}`) + .set({ + 'Authorization': config.botskey + }); + const embed = new Discord.RichEmbed() + .setColor(0x9797FF) + .setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg') + .setTitle(response.body.name) + .setURL('https://bots.discord.pw/') + .setDescription(response.body.description) + .addField('**Library:**', + response.body.library, true) + .addField('**Prefix:**', + response.body.prefix, true) + .addField('**Invite:**', + `[Here](${response.body.invite_url})`, true); + message.channel.sendEmbed(embed); + } + catch (err) { + message.channel.send(":x: Error! Bot not Found!"); + } } else { - return message.channel.send(':x: Please mention one bot!'); + message.channel.send(':x: Error! Please mention one bot!'); } } }; diff --git a/commands/search/define.js b/commands/search/define.js index 7c76e2b7..068300c9 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -26,24 +26,24 @@ module.exports = class DefineCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let defineThis = encodeURI(message.content.split(" ").slice(1).join(" ")); - return 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.body[0].word) - .setDescription(response.body[0].text); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! Word not Found!"); - }); + try { + let response = await 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 + }); + const embed = new Discord.RichEmbed() + .setColor(0x9797FF) + .setTitle(response.body[0].word) + .setDescription(response.body[0].text); + message.channel.sendEmbed(embed).catch(console.error); + } + catch (err) { + message.channel.send(":x: Error! Word not Found!"); + } } }; diff --git a/commands/search/discrim.js b/commands/search/discrim.js index b0413a49..66b9984b 100644 --- a/commands/search/discrim.js +++ b/commands/search/discrim.js @@ -27,10 +27,10 @@ module.exports = class DiscrimCommand extends commando.Command { const embed = new Discord.RichEmbed() .setTitle(`${users.length} Users with the discriminator: ${userToSearch}`) .setDescription(users.join(', ')); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed); } else { - return message.channel.send(':x: Error! This discriminator is invalid!'); + message.channel.send(':x: Error! This discriminator is invalid!'); } } }; diff --git a/commands/search/forecast.js b/commands/search/forecast.js index 01871829..c987c814 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -22,7 +22,8 @@ module.exports = class ForecastCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let locationToSearch = message.content.split(" ").slice(1).join(" "); - return weather(locationToSearch, 'f').then(info => { + try { + let info = await weather(locationToSearch, 'f'); const embed = new Discord.RichEmbed() .setColor(0x0000FF) .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') @@ -42,10 +43,10 @@ module.exports = class ForecastCommand extends commando.Command { `**High:** ${info.item.forecast[5].high}°F, **Low:** ${info.item.forecast[5].low}°F, **Condition:** ${info.item.forecast[5].text}`) .addField(`**${info.item.forecast[6].day} - ${info.item.forecast[6].date}:**`, `**High:** ${info.item.forecast[6].high}°F, **Low:** ${info.item.forecast[6].low}°F, **Condition:** ${info.item.forecast[6].text}`); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(err => { - console.log(err); - return message.channel.send(":x: Error! Make sure you typed the location correctly!"); - }); + message.channel.sendEmbed(embed); + } + catch (err) { + message.channel.send(":x: Error! Make sure you typed the location correctly!"); + } } }; diff --git a/commands/search/google.js b/commands/search/google.js index 34a43a77..ad239bcb 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -23,19 +23,18 @@ module.exports = class DefineCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" ")); - await message.channel.send('Searching...').then(msg => { - return request - .get(`https://www.google.com/search?q=${thingToSearch}`) - .then(function(response) { - const $ = cheerio.load(response.text); - let href = $('.r').first().find('a').first().attr('href'); - if (!href) return Promise.reject(new Error('NO RESULTS')); - href = querystring.parse(href.replace('/url?', '')); - return msg.edit(href.q); - }).catch(function(err) { - console.log(err); - return msg.edit(':x: Error! No Results Found!'); - }); - }); + let searchMsg = await message.channel.send('Searching...'); + try { + let response = await request + .get(`https://www.google.com/search?q=${thingToSearch}`); + const $ = cheerio.load(response.text); + let href = $('.r').first().find('a').first().attr('href'); + if (!href) return Promise.reject(new Error('NO RESULTS')); + href = querystring.parse(href.replace('/url?', '')); + searchMsg.edit(href.q); + } + catch (err) { + searchMsg.edit(':x: Error! No Results Found!'); + } } }; diff --git a/commands/search/image.js b/commands/search/image.js index ef0f2882..1aa29996 100644 --- a/commands/search/image.js +++ b/commands/search/image.js @@ -23,17 +23,16 @@ module.exports = class DefineCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" ")); - await message.channel.send('Searching...').then(msg => { - return request - .get(`https://www.google.com/search?tbm=isch&gs_l=img&q=${encodeURI(thingToSearch)}`) - .then(function(response) { - const $ = cheerio.load(response.text); - const result = $('.images_table').find('img').first().attr('src'); - return msg.edit(result); - }).catch(function(err) { - console.log(err); - return msg.edit(':x: Error! No Results Found!'); - }); - }); + let searchMsg = await message.channel.send('Searching...'); + try { + let response = await request + .get(`https://www.google.com/search?tbm=isch&gs_l=img&q=${encodeURI(thingToSearch)}`); + const $ = cheerio.load(response.text); + const result = $('.images_table').find('img').first().attr('src'); + searchMsg.edit(result); + } + catch (err) { + searchMsg.edit(':x: Error! No Results Found!'); + } } }; diff --git a/commands/search/imdb.js b/commands/search/imdb.js index 8d9d4e6d..f6c4328a 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -54,7 +54,7 @@ module.exports = class IMDBCommand extends commando.Command { movie.writer) .addField('**Actors:**', movie.actors); - return message.channel.sendEmbed(embed).catch(console.error); + return message.channel.sendEmbed(embed); } }); } diff --git a/commands/search/neopet.js b/commands/search/neopet.js index 177613fc..b6e87ca1 100644 --- a/commands/search/neopet.js +++ b/commands/search/neopet.js @@ -18,10 +18,12 @@ module.exports = class NeopetCommand extends commando.Command { console.log(`[Command] ${message.content}`); let petID = encodeURI(message.content.toLowerCase().split(" ").slice(1).join(" ")); if (petID === "getid") { - return 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."))); + let petIDMsg = await 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!"); + let petIDMsg2 = await message.channel.sendFile('./images/PetID.png'); + let petIDMsg3 = await 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 { - return 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."))); + 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."))); } } }; diff --git a/commands/search/osu.js b/commands/search/osu.js index 9d687985..101e27ce 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -25,51 +25,51 @@ module.exports = class OsuCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let usernameToSearch = message.content.split(" ").slice(1).join(" "); - return request - .get('https://osu.ppy.sh/api/get_user') - .query({ - k: config.osukey, - u: usernameToSearch, - type: 'string' - }) - .then(function(response) { - if (!response.body[0]) { - return message.channel.send(":x: Error! User not found!"); - } - else { - const embed = new Discord.RichEmbed() - .setColor(0xFF66AA) - .setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209') - .setURL('https://osu.ppy.sh/') - .addField('**Username:**', - response.body[0].username, true) - .addField('**ID:**', - response.body[0].user_id, true) - .addField('**Level:**', - response.body[0].level, true) - .addField('**Accuracy**', - response.body[0].accuracy, true) - .addField('**Rank:**', - response.body[0].pp_rank, true) - .addField('**Play Count:**', - response.body[0].playcount, true) - .addField('**Country:**', - response.body[0].country, true) - .addField('**Ranked Score:**', - response.body[0].ranked_score, true) - .addField('**Total Score:**', - response.body[0].total_score, true) - .addField('**SS:**', - response.body[0].count_rank_ss, true) - .addField('**S:**', - response.body[0].count_rank_s, true) - .addField('**A:**', - response.body[0].count_rank_a, true); - return message.channel.sendEmbed(embed).catch(console.error); - } - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! User not Found!"); - }); + try { + let response = await request + .get('https://osu.ppy.sh/api/get_user') + .query({ + k: config.osukey, + u: usernameToSearch, + type: 'string' + }); + if (!response.body[0]) { + message.channel.send(":x: Error! User not found!"); + } + else { + const embed = new Discord.RichEmbed() + .setColor(0xFF66AA) + .setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209') + .setURL('https://osu.ppy.sh/') + .addField('**Username:**', + response.body[0].username, true) + .addField('**ID:**', + response.body[0].user_id, true) + .addField('**Level:**', + response.body[0].level, true) + .addField('**Accuracy**', + response.body[0].accuracy, true) + .addField('**Rank:**', + response.body[0].pp_rank, true) + .addField('**Play Count:**', + response.body[0].playcount, true) + .addField('**Country:**', + response.body[0].country, true) + .addField('**Ranked Score:**', + response.body[0].ranked_score, true) + .addField('**Total Score:**', + response.body[0].total_score, true) + .addField('**SS:**', + response.body[0].count_rank_ss, true) + .addField('**S:**', + response.body[0].count_rank_s, true) + .addField('**A:**', + response.body[0].count_rank_a, true); + message.channel.sendEmbed(embed); + } + } + catch (err) { + message.channel.send(":x: Error! User not Found!"); + } } }; diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index aa86b585..1e2195b6 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -34,10 +34,10 @@ module.exports = class PokedexCommand extends commando.Command { pokedex.entry[pokemon]) .addField('Type', pokedex.type[pokemon]); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed).catch(console.error); } else { - return message.channel.send(":x: This Pokémon either doesn't exist, or isn't implemented yet."); + message.channel.send(":x: This Pokémon either doesn't exist, or isn't implemented yet."); } } }; diff --git a/commands/search/urban.js b/commands/search/urban.js index a92dc45a..2c990186 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -26,10 +26,10 @@ module.exports = class UrbanDictionary extends commando.Command { let wordToDefine = message.content.split(" ").slice(1).join(" "); urban(wordToDefine).first(function(response) { if (!response) { - return message.channel.send(":x: Error! Word not found!"); + message.channel.send(":x: Error! Word not found!"); } else if (!response.definition) { - return message.channel.send(":x: Error! Word has no definition!"); + message.channel.send(":x: Error! Word has no definition!"); } else if (response.example) { const embed = new Discord.RichEmbed() @@ -40,7 +40,7 @@ module.exports = class UrbanDictionary extends commando.Command { .setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`) .addField('**Example:**', response.example.substr(0, 1900)); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed); } else { const embed = new Discord.RichEmbed() @@ -49,7 +49,7 @@ module.exports = class UrbanDictionary extends commando.Command { .setURL(response.permalink) .setTitle(response.word) .setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed); } }); } diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index 06832770..e0c862b8 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -20,38 +20,38 @@ module.exports = class WattpadCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let queryBook = message.content.split(" ").slice(1).join(" "); - return 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.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.body.stories[0].user, true) - .addField('**Parts:**', - response.body.stories[0].numParts, true) - .addField('**Created On:**', - response.body.stories[0].createDate, true) - .addField('**Votes:**', - response.body.stories[0].voteCount, true) - .addField('**Reads:**', - response.body.stories[0].readCount, true) - .addField('**Comments:**', - response.body.stories[0].commentCount, true); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! Book not Found!"); - }); + try { + let response = await request + .get('https://api.wattpad.com:443/v4/stories') + .set({ + 'Authorization': `Basic ${config.wattpadkey}` + }) + .query({ + query: queryBook, + limit: 1 + }); + const embed = new Discord.RichEmbed() + .setColor(0xF89C34) + .setAuthor('Wattpad', 'http://www.selfpubtoolbox.com/wp-content/uploads/2015/05/a6044fd3a88acd5043860484db972ca6.png') + .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.body.stories[0].user, true) + .addField('**Parts:**', + response.body.stories[0].numParts, true) + .addField('**Created On:**', + response.body.stories[0].createDate, true) + .addField('**Votes:**', + response.body.stories[0].voteCount, true) + .addField('**Reads:**', + response.body.stories[0].readCount, true) + .addField('**Comments:**', + response.body.stories[0].commentCount, true); + message.channel.sendEmbed(embed); + } + catch (err) { + message.channel.send(":x: Error! Book not Found!"); + } } }; diff --git a/commands/search/weather.js b/commands/search/weather.js index e99bf602..5246071c 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -19,7 +19,8 @@ module.exports = class WeatherCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let locationToSearch = message.content.split(" ").slice(1).join(" "); - return weather(locationToSearch, 'f').then(info => { + try { + let info = await weather(locationToSearch, 'f'); const embed = new Discord.RichEmbed() .setColor(0x0000FF) .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') @@ -49,10 +50,10 @@ module.exports = class WeatherCommand extends commando.Command { info.wind.direction, true) .addField('**Wind Speed:**', info.wind.speed, true); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(err => { - console.log(err); - return message.channel.send(":x: Error! Make sure you typed the location correctly!"); - }); + message.channel.sendEmbed(embed); + } + catch (err) { + message.channel.send(":x: Error! Make sure you typed the location correctly!"); + } } }; diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 266b5135..5e85468b 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -20,28 +20,28 @@ module.exports = class WikipediaCommand extends commando.Command { console.log(`[Command] ${message.content}`); let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" ")); thingToSearch = thingToSearch.split(")").join("%29"); - return 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; - if (!description) { - return message.channel.send(":x: Error! Entry Not Found!"); - } - else { - description = description.substr(0, 1900); - description = description.split('\n').join("\n\n"); - const embed = new Discord.RichEmbed() - .setColor(0xE7E7E7) - .setTitle(name) - .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} [Read the Rest Here](https://en.wikipedia.org/wiki/${thingToSearch})`); - return message.channel.sendEmbed(embed).catch(console.error); - } - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! Entry Not Found!"); - }); + try { + let response = await request + .get(`https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=${thingToSearch}&exintro=&explaintext=&redirects=&formatversion=2`); + let description = response.body.query.pages[0].extract; + let name = response.body.query.pages[0].title; + if (!description) { + message.channel.send(":x: Error! Entry Not Found!"); + } + else { + description = description.substr(0, 1900); + description = description.split('\n').join("\n\n"); + const embed = new Discord.RichEmbed() + .setColor(0xE7E7E7) + .setTitle(name) + .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} [Read the Rest Here](https://en.wikipedia.org/wiki/${thingToSearch})`); + message.channel.sendEmbed(embed); + } + } + catch (err) { + message.channel.send(":x: Error! Entry Not Found!"); + } } }; diff --git a/commands/search/youtube.js b/commands/search/youtube.js index aa3fddbd..53483819 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -23,32 +23,32 @@ module.exports = class YouTubeCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let videoToSearch = message.content.split(" ").slice(1).join("-"); - return 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) { - return message.channel.send(':x: Error! No Video Found!'); - } - else { - const embed = new Discord.RichEmbed() - .setColor(0xDD2825) - .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); - return message.channel.sendEmbed(embed).catch(console.error); - } - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! An error has occurred! Try again later! (If this continues to occur, the daily quota may have been reached)."); - }); + try { + let response = await request + .get('https://www.googleapis.com/youtube/v3/search') + .query({ + part: 'snippet', + type: 'video', + maxResults: 1, + q: videoToSearch, + key: config.youtubekey + }); + if (!response.body.items[0].snippet) { + message.channel.send(':x: Error! No Video Found!'); + } + else { + const embed = new Discord.RichEmbed() + .setColor(0xDD2825) + .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 (err) { + message.channel.send(":x: Error! An error has occurred! Try again later! (If this continues to occur, the daily quota may have been reached)."); + } } }; diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index 50821e24..7e2bbd6a 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -19,42 +19,42 @@ module.exports = class YuGiOhCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let cardName = encodeURI(message.content.split(" ").slice(1).join(" ")); - return request - .get(`http://yugiohprices.com/api/card_data/${cardName}`) - .then(function(response) { - if (response.body.data.card_type === 'monster') { - const embed = new Discord.RichEmbed() - .setColor(0xBE5F1F) - .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.body.data.card_type, true) - .addField('**Species:**', - response.body.data.type, true) - .addField('**Attribute:**', - response.body.data.family, true) - .addField('**ATK:**', - response.body.data.atk, true) - .addField('**DEF:**', - response.body.data.def, true) - .addField('**Level:**', - response.body.data.level, true); - return message.channel.sendEmbed(embed).catch(console.error); - } - else { - const embed = new Discord.RichEmbed() - .setColor(0xBE5F1F) - .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.body.data.card_type, true); - return message.channel.sendEmbed(embed).catch(console.error); - } - }).catch(function(err) { - console.log(err); - return 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!"); - }); + try { + let response = await request + .get(`http://yugiohprices.com/api/card_data/${cardName}`); + if (response.body.data.card_type === 'monster') { + const embed = new Discord.RichEmbed() + .setColor(0xBE5F1F) + .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.body.data.card_type, true) + .addField('**Species:**', + response.body.data.type, true) + .addField('**Attribute:**', + response.body.data.family, true) + .addField('**ATK:**', + response.body.data.atk, true) + .addField('**DEF:**', + response.body.data.def, true) + .addField('**Level:**', + response.body.data.level, true); + message.channel.sendEmbed(embed); + } + else { + const embed = new Discord.RichEmbed() + .setColor(0xBE5F1F) + .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.body.data.card_type, true); + message.channel.sendEmbed(embed); + } + } + catch (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!"); + } } }; diff --git a/commands/textedit/binary.js b/commands/textedit/binary.js index 281d193a..a209736e 100644 --- a/commands/textedit/binary.js +++ b/commands/textedit/binary.js @@ -18,6 +18,11 @@ module.exports = class BinaryCommand extends commando.Command { } console.log(`[Command] ${message.content}`); let turnToBinary = message.content.split(" ").slice(1).join(" "); - return message.channel.send(stringToBinary(turnToBinary)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!')); + try { + message.channel.send(stringToBinary(turnToBinary)); + } + catch (err) { + message.channel.send(':x: Error! Translation is too long, or nothing was entered!'); + } } }; diff --git a/commands/textedit/cowsay.js b/commands/textedit/cowsay.js index fcdd3609..f12e4ad5 100644 --- a/commands/textedit/cowsay.js +++ b/commands/textedit/cowsay.js @@ -18,17 +18,20 @@ module.exports = class CowsayCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (!message.content.split(" ").slice(1).join(" ")) { - return message.channel.send(":x: Error! You entered nothing!"); + message.channel.send(":x: Error! You entered nothing!"); } else { let turnToCowsay = message.content.split(" ").slice(1).join(" "); - return message.channel.sendCode(null, cowsay.say({ - text: turnToCowsay, - e: "oO", - T: "U " - })).catch(error => { - return message.channel.send(':x: Error! Perhaps the content is too long?'); - }); + try { + message.channel.sendCode(null, cowsay.say({ + text: turnToCowsay, + e: "oO", + T: "U " + })); + } + catch (err) { + message.channel.send(':x: Error! Perhaps the content is too long?'); + } } } }; diff --git a/commands/textedit/embed.js b/commands/textedit/embed.js index c85ac33f..d98e2a9e 100644 --- a/commands/textedit/embed.js +++ b/commands/textedit/embed.js @@ -19,7 +19,7 @@ module.exports = class EmbedCommand extends commando.Command { console.log(`[Command] ${message.content}`); let embedMessage = message.content.split(" ").slice(1).join(" "); if (!embedMessage) { - return message.channel.send(":x: Error! Nothing to embed!"); + message.channel.send(":x: Error! Nothing to embed!"); } else { if (message.channel.type === 'dm') { @@ -28,7 +28,7 @@ module.exports = class EmbedCommand extends commando.Command { .setColor(0x00AE86) .setTimestamp() .setDescription(embedMessage); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed).catch(console.error); } else { const embed = new Discord.RichEmbed() @@ -36,8 +36,8 @@ module.exports = class EmbedCommand extends commando.Command { .setColor(0x00AE86) .setTimestamp() .setDescription(embedMessage); - await message.delete(); - return message.channel.sendEmbed(embed).catch(console.error); + message.delete(); + message.channel.sendEmbed(embed).catch(console.error); } } } diff --git a/commands/textedit/morse.js b/commands/textedit/morse.js index 2e198e91..01316925 100644 --- a/commands/textedit/morse.js +++ b/commands/textedit/morse.js @@ -23,16 +23,26 @@ module.exports = class MorseCommand extends commando.Command { let [methodToUse] = message.content.toLowerCase().split(" ").slice(1); let toMorse = message.content.split(" ").slice(2).join(" "); if (!toMorse) { - return message.channel.send(":x: Error! Nothing to translate! Perhaps you forgot to set the method? Use either encode or decode before your text."); + message.channel.send(":x: Error! Nothing to translate! Perhaps you forgot to set the method? Use either encode or decode before your text."); } else if (methodToUse === 'encode') { - return message.channel.send(morse.encode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); + try { + message.channel.send(morse.encode(toMorse)); + } + catch (err) { + message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'); + } } else if (methodToUse === 'decode') { - return message.channel.send(morse.decode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); + try { + message.channel.send(morse.decode(toMorse)); + } + catch (err) { + message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'); + } } else { - return message.channel.send(":x: Error! Method not set/not correct! Use either encode or decode."); + message.channel.send(":x: Error! Method not set/not correct! Use either encode or decode."); } } }; diff --git a/commands/textedit/pirate.js b/commands/textedit/pirate.js index 82d8e096..e48d97de 100644 --- a/commands/textedit/pirate.js +++ b/commands/textedit/pirate.js @@ -24,14 +24,14 @@ module.exports = class PirateCommand extends commando.Command { let turnToPirate = message.content.split(" ").slice(1).join(" "); let pirate = pirateSpeak.translate(turnToPirate); if (!turnToPirate) { - return message.channel.send(":x: Error! Nothing to translate!"); + message.channel.send(":x: Error! Nothing to translate!"); } else { if (pirate.length > 1950) { - return message.channel.send(":x: Error! Your message is too long!"); + message.channel.send(":x: Error! Your message is too long!"); } else { - return message.channel.send(pirate); + message.channel.send(pirate); } } } diff --git a/commands/textedit/reverse.js b/commands/textedit/reverse.js index 161dd1cc..5f58843f 100644 --- a/commands/textedit/reverse.js +++ b/commands/textedit/reverse.js @@ -18,11 +18,11 @@ module.exports = class ReverseCommand extends commando.Command { console.log(`[Command] ${message.content}`); let stringToReverse = message.content.split(" ").slice(1).join(" "); if (!stringToReverse) { - return message.channel.send(":x: Error! Nothing to reverse!"); + message.channel.send(":x: Error! Nothing to reverse!"); } else { let reversed = stringToReverse.split("").reverse().join(""); - return message.channel.send(reversed); + message.channel.send(reversed); } } }; diff --git a/commands/textedit/rin.js b/commands/textedit/rin.js index f10ae73a..841d0783 100644 --- a/commands/textedit/rin.js +++ b/commands/textedit/rin.js @@ -21,21 +21,22 @@ module.exports = class RinSayCommand extends commando.Command { async run(message) { if (message.channel.type !== 'dm') { - if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; + if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); let rinContent = message.content.split(" ").slice(1).join(" "); - return request - .post(config.webhook) - .send({ - content: rinContent - }) - .then(function(parsedBody) { - if (message.content.type === 'dm') return; - return message.delete(); - }).catch(function(err) { - console.log(err); - return message.channel.send(':x: Error! Message failed to send! Check the logs for details.'); - }); + try { + let post = await request + .post(config.webhook) + .send({ + content: rinContent + }); + if (message.content.type !== 'dm') { + message.delete(); + } + } + catch (err) { + message.channel.send(':x: Error! Message failed to send!'); + } } }; diff --git a/commands/textedit/romaji.js b/commands/textedit/romaji.js index 55164af2..641fe707 100644 --- a/commands/textedit/romaji.js +++ b/commands/textedit/romaji.js @@ -24,14 +24,14 @@ module.exports = class RomajiCommand extends commando.Command { if (hepburn.containsKana(romajify)) { let romajified = hepburn.fromKana(romajify); if (romajified.length > 1950) { - return message.channel.send(":x: Error! Your message is too long!"); + message.channel.send(":x: Error! Your message is too long!"); } else { - return message.channel.send(romajified); + message.channel.send(romajified); } } else { - return message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!"); + message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!"); } } }; diff --git a/commands/textedit/say.js b/commands/textedit/say.js index a0e8eca5..fae6e275 100644 --- a/commands/textedit/say.js +++ b/commands/textedit/say.js @@ -24,15 +24,15 @@ module.exports = class SayCommand extends commando.Command { console.log(`[Command] ${message.content}`); let copycat = message.content.split(" ").slice(1).join(" "); if (!copycat) { - return message.channel.send(":x: Error! Nothing to say!"); + message.channel.send(":x: Error! Nothing to say!"); } else { if (message.channel.type === 'dm') { - return message.channel.send(copycat); + message.channel.send(copycat); } else { - await message.delete(); - return message.channel.send(copycat); + message.delete(); + message.channel.send(copycat); } } } diff --git a/commands/textedit/shuffle.js b/commands/textedit/shuffle.js index 5a5f57c0..09ab157a 100644 --- a/commands/textedit/shuffle.js +++ b/commands/textedit/shuffle.js @@ -30,10 +30,10 @@ module.exports = class ShuffleCommand extends commando.Command { console.log(`[Command] ${message.content}`); let thingToShuffle = message.content.split(" ").slice(1).join(" "); if (!thingToShuffle) { - return message.channel.send(":x: Error! Nothing to shuffle!"); + message.channel.send(":x: Error! Nothing to shuffle!"); } else { - return message.channel.send(thingToShuffle.shuffle()); + message.channel.send(thingToShuffle.shuffle()); } } }; diff --git a/commands/textedit/temmie.js b/commands/textedit/temmie.js index 5a5d6d45..8052e9c7 100644 --- a/commands/textedit/temmie.js +++ b/commands/textedit/temmie.js @@ -213,7 +213,24 @@ const dictionary = { "sorcery": "magics", "superpower": "magics", "superpowers": "magics", - "sorceries": "magics" + "sorceries": "magics", + "and": "n", + "my": "tem's", + "mine": "tem's", + "everyone": "everytem", + "anyone": "anytem", + "someone": "sometem", + "everbody": "everytemmie", + "anybody": "anytemmie", + "somebody": "sometemmie", + "beautiful": "booftifull", + "pretty": "prety", + "so": "soooo", + "help": "halp", + "uh-uh": "nuh", + "nope": "nuh", + "nuh-uh": "nuh", + "please": "pls" }; function translateWord(word) { @@ -288,11 +305,11 @@ module.exports = class TemmieCommand extends commando.Command { console.log(`[Command] ${message.content}`); let thingToTranslate = message.content.split(" ").slice(1).join(" "); if (!thingToTranslate) { - return message.channel.send(':x: Error! Nothing to translate!'); + message.channel.send(':x: Error! Nothing to translate!'); } else { let temmized = temmize(thingToTranslate); - return message.channel.send(temmized); + message.channel.send(temmized); } } }; diff --git a/commands/textedit/translate.js b/commands/textedit/translate.js index d3e39187..1efecaef 100644 --- a/commands/textedit/translate.js +++ b/commands/textedit/translate.js @@ -2,7 +2,7 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); const translate = require('google-translate-api'); -const languages = { +const languages = { "auto": "Automatic", "af": "Afrikaans", "sq": "Albanian", @@ -128,19 +128,20 @@ module.exports = class TranslateCommand extends commando.Command { let [languageto] = message.content.toLowerCase().split(" ").slice(1); let thingToTranslate = message.content.split(" ").slice(2).join(" "); if (languageto === "list") { - return 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'"); + 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[languageto]) { if (!thingToTranslate) { - return message.channel.send(":x: Error! Nothing to translate!"); + message.channel.send(":x: Error! Nothing to translate!"); } else if (thingToTranslate.length > 200) { - return message.channel.send(":x: Error! Please keep translations below 200 characters!"); + message.channel.send(":x: Error! Please keep translations below 200 characters!"); } else { - return translate(thingToTranslate, { - to: languageto - }).then(res => { + try { + let res = await translate(thingToTranslate, { + to: languageto + }); let languagefrom = res.from.language.iso.toLowerCase(); const embed = new Discord.RichEmbed() .setColor(0x00AE86) @@ -148,15 +149,15 @@ module.exports = class TranslateCommand extends commando.Command { thingToTranslate) .addField(`Translation (To: ${languages[languageto]}):`, res.text); - return message.channel.sendEmbed(embed).catch(console.error); - }).catch(err => { - console.log(err); - return message.channel.send(":x: Error! Something went wrong!"); - }); + message.channel.sendEmbed(embed).catch(console.error); + } + catch (err) { + message.channel.send(":x: Error! Something went wrong!"); + } } } else { - return message.channel.send(":x: Error! Language not found! Use `;translate list` to view a list of translate codes!"); + message.channel.send(":x: Error! Language not found! Use `;translate list` to view a list of translate codes!"); } } }; diff --git a/commands/textedit/yoda.js b/commands/textedit/yoda.js index 7d2b53c7..1d9152c1 100644 --- a/commands/textedit/yoda.js +++ b/commands/textedit/yoda.js @@ -20,29 +20,29 @@ module.exports = class YodaCommand extends commando.Command { console.log(`[Command] ${message.content}`); let turnToYoda = message.content.split(" ").slice(1).join(" "); if (!turnToYoda) { - return message.channel.send(':x: Error! Nothing to translate!'); + message.channel.send(':x: Error! Nothing to translate!'); } else { - return 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) { - return message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'); - } - else { - return message.channel.send(response.text).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.')); - } - }).catch(function(err) { - console.log(err); - return message.channel.send(":x: Error! Unknown Error. Try again later!"); - }); + try { + let response = await request + .get('https://yoda.p.mashape.com/yoda') + .set({ + 'X-Mashape-Key': config.mashapekey, + 'Accept': 'text/plain' + }) + .query({ + sentence: turnToYoda + }); + if (!response) { + message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'); + } + else { + message.channel.send(response.text); + } + } + catch (err) { + message.channel.send(":x: Error! Something went wrong!"); + } } } }; diff --git a/commands/textedit/zalgo.js b/commands/textedit/zalgo.js index 54bd6537..cd7b0c0c 100644 --- a/commands/textedit/zalgo.js +++ b/commands/textedit/zalgo.js @@ -19,13 +19,13 @@ module.exports = class ZalgoCommand extends commando.Command { console.log(`[Command] ${message.content}`); let zalgoified = zalgo(message.content.split(" ").slice(1).join(" ")); if (!zalgoified) { - return message.channel.send(":x: Error! Nothing to zalgoify!"); + message.channel.send(":x: Error! Nothing to zalgoify!"); } else if (zalgoified.length > 1950) { - return message.channel.send(":x: Error! Your message is too long!"); + message.channel.send(":x: Error! Your message is too long!"); } else { - return message.channel.send(zalgoified); + message.channel.send(zalgoified); } } }; diff --git a/commands/userinfo/avatar.js b/commands/userinfo/avatar.js index 20363c23..0e7afb75 100644 --- a/commands/userinfo/avatar.js +++ b/commands/userinfo/avatar.js @@ -17,14 +17,14 @@ module.exports = class AvatarCommand extends commando.Command { } console.log(`[Command] ${message.content}`); if (message.mentions.users.size !== 1) { - return message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().avatarURL) { - return message.channel.send(":x: Error! This person has no avatar!"); + message.channel.send(":x: Error! This person has no avatar!"); } else { - return message.channel.send(message.mentions.users.first().avatarURL); + message.channel.send(message.mentions.users.first().avatarURL); } } } diff --git a/commands/userinfo/userinfo.js b/commands/userinfo/userinfo.js index 73250da5..e4934af3 100644 --- a/commands/userinfo/userinfo.js +++ b/commands/userinfo/userinfo.js @@ -54,7 +54,7 @@ module.exports = class UserInfoCommand extends commando.Command { break; } if (message.mentions.users.size !== 1) { - return message.channel.send(':x: Error! Please mention one user!'); + message.channel.send(':x: Error! Please mention one user!'); } else { if (!message.mentions.users.first().presence.game) { @@ -73,7 +73,7 @@ module.exports = class UserInfoCommand extends commando.Command { stat, true) .addField('**Playing:**', "None", true); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed).catch(console.error); } else { const embed = new Discord.RichEmbed() @@ -91,12 +91,12 @@ module.exports = class UserInfoCommand extends commando.Command { stat, true) .addField('**Playing:**', message.mentions.users.first().presence.game.name, true); - return message.channel.sendEmbed(embed).catch(console.error); + message.channel.sendEmbed(embed).catch(console.error); } } } else { - return message.channel.send(":x: Error! This command does not work in DM!"); + message.channel.send(":x: Error! This command does not work in DM!"); } } }; diff --git a/commands/util/servers.js b/commands/util/servers.js index e633807d..88501e5a 100644 --- a/commands/util/servers.js +++ b/commands/util/servers.js @@ -25,6 +25,6 @@ module.exports = class ServersCommand extends commando.Command { let guildCount = this.client.guilds.size; let guildNames = this.client.guilds.map(g => `${g.name} (${g.id})`).join(", "); console.log(`${guildCount} Servers: ${guildNames}`); - return message.channel.send("Sent the information to the console!"); + message.channel.send("Sent the information to the console!"); } }; diff --git a/html/carbondesc.html b/html/carbondesc.html index 4af7cf23..4cd6900c 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -49,11 +49,12 @@
  • Yoda Speak API
  • Discord Bots API
  • Today in History API
  • +
  • jService API
  • Information

    diff --git a/html/discordbots.html b/html/discordbots.html index 13612450..3df3d2f8 100644 --- a/html/discordbots.html +++ b/html/discordbots.html @@ -97,11 +97,12 @@
  • Yoda Speak API
  • Discord Bots API
  • Today in History API
  • +
  • jService API
  • Information