From 85356dd2a90807c4a2baa0d319335a93f5169e91 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 11 Apr 2017 18:52:18 +0000 Subject: [PATCH] Another Rewrite Type Thing --- README.md | 2 +- commands/botinfo/contact.js | 33 -------------- commands/games/lottery.js | 7 +-- commands/games/mathgame.js | 35 +++++++-------- commands/games/quiz.js | 13 +++--- commands/games/typinggame.js | 19 ++++---- commands/imageedit/meme.js | 10 +++-- commands/moderation/ban.js | 12 +++-- commands/moderation/kick.js | 12 +++-- commands/moderation/lockdown.js | 8 ++-- commands/moderation/unban.js | 9 ++-- commands/moderation/warn.js | 9 ++-- commands/numedit/roman.js | 8 ++-- commands/{response => random}/motivate.js | 6 +-- commands/{response => randomimg}/cat.js | 2 +- commands/{response => randomimg}/potato.js | 2 +- commands/{response => randomimg}/pun.js | 2 +- commands/randomimg/vocaloid.js | 25 +++++++++++ commands/{response => randomimg}/xiaopai.js | 8 ++-- commands/response/8ball.js | 6 +-- commands/response/choose.js | 6 +-- commands/response/compliment.js | 8 ++-- commands/response/factcore.js | 6 +-- commands/response/fortune.js | 6 +-- commands/response/name.js | 16 +++---- commands/response/ratewaifu.js | 4 +- commands/response/roast.js | 13 ++---- commands/response/ship.js | 4 +- commands/response/vocaloid.js | 25 ----------- commands/roleplay/cuddle.js | 4 +- commands/roleplay/divorce.js | 4 +- commands/roleplay/eat.js | 4 +- commands/roleplay/falconpunch.js | 4 +- commands/roleplay/fistbump.js | 4 +- commands/roleplay/highfive.js | 4 +- commands/roleplay/hitwithshovel.js | 4 +- commands/roleplay/hug.js | 4 +- commands/roleplay/inhales.js | 4 +- commands/roleplay/kill.js | 4 +- commands/roleplay/kiss.js | 4 +- commands/roleplay/marries.js | 4 +- commands/roleplay/pat.js | 4 +- commands/roleplay/poke.js | 4 +- commands/roleplay/punch.js | 4 +- commands/roleplay/slap.js | 4 +- commands/search/botinfo.js | 4 +- commands/search/define.js | 4 +- commands/search/discrim.js | 6 +-- commands/search/forecast.js | 4 +- commands/search/google.js | 10 ++--- commands/search/imdb.js | 4 +- commands/search/osu.js | 4 +- commands/search/urban.js | 4 +- commands/search/wattpad.js | 4 +- commands/search/weather.js | 4 +- commands/search/wikipedia.js | 6 +-- commands/search/youtube.js | 4 +- commands/search/yugioh.js | 4 +- commands/textedit/binary.js | 6 +-- commands/textedit/cowsay.js | 4 +- commands/textedit/embed.js | 4 +- commands/textedit/morse.js | 6 +-- commands/textedit/pirate.js | 5 +-- commands/textedit/reverse.js | 4 +- commands/textedit/romaji.js | 6 +-- commands/textedit/say.js | 4 +- commands/textedit/shuffle.js | 5 ++- commands/textedit/temmie.js | 4 +- commands/textedit/temmize.js | 22 ++++----- commands/textedit/translate.js | 4 +- commands/textedit/webhook.js | 4 +- commands/textedit/yoda.js | 4 +- commands/textedit/zalgo.js | 3 +- commands/{botinfo => util}/info.js | 4 +- commands/{botinfo => util}/invite.js | 2 +- commands/util/sendDM.js | 50 --------------------- commands/util/servers.js | 2 +- commands/{botinfo => util}/shardinfo.js | 19 ++++---- commands/{botinfo => util}/uptime.js | 4 +- html/carbondesc.html | 2 +- html/discordbots.html | 2 +- index.js | 25 ++++++----- 82 files changed, 271 insertions(+), 366 deletions(-) delete mode 100644 commands/botinfo/contact.js rename commands/{response => random}/motivate.js (81%) rename commands/{response => randomimg}/cat.js (97%) rename commands/{response => randomimg}/potato.js (96%) rename commands/{response => randomimg}/pun.js (97%) create mode 100644 commands/randomimg/vocaloid.js rename commands/{response => randomimg}/xiaopai.js (66%) delete mode 100644 commands/response/vocaloid.js rename commands/{botinfo => util}/info.js (98%) rename commands/{botinfo => util}/invite.js (96%) delete mode 100644 commands/util/sendDM.js rename commands/{botinfo => util}/shardinfo.js (87%) rename commands/{botinfo => util}/uptime.js (86%) diff --git a/README.md b/README.md index 77e8022e..89d46aa4 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You can Self-Host the bot easily, provided you have API keys and a Discord Bot T APIs that require API Keys: -[Wattpad API](https://developer.wattpad.com/docs/api) | [Wordnik API](http://developer.wordnik.com/docs.html) | [osu! API](https://osu.ppy.sh/p/api) | [YouTube Data API](https://developers.google.com/youtube/v3/) | [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak) | [Yandex.Translate API](https://translate.yandex.com/developers) +[Wattpad](https://developer.wattpad.com/docs/api) | [Wordnik](http://developer.wordnik.com/docs.html) | [osu!](https://osu.ppy.sh/p/api) | [YouTube Data](https://developers.google.com/youtube/v3/) | [Yoda Speak](https://market.mashape.com/ismaelc/yoda-speak) | [Yandex.Translate](https://translate.yandex.com/developers) > Note: If you do self-host, you will need to go into the file `index.js` and remove the entries for requests to Discord Bots and Carbon. diff --git a/commands/botinfo/contact.js b/commands/botinfo/contact.js deleted file mode 100644 index 127c4b97..00000000 --- a/commands/botinfo/contact.js +++ /dev/null @@ -1,33 +0,0 @@ -const { Command } = require('discord.js-commando'); - -module.exports = class ContactCommand extends Command { - constructor(client) { - super(client, { - name: 'contact', - aliases: [ - 'suggest', - 'report', - 'bug' - ], - group: 'botinfo', - memberName: 'contact', - description: 'Report bugs or request new features. (;contact Fix this command!)', - examples: [';contact Fix this command!'], - args: [{ - key: 'report', - prompt: 'What would you like to report?', - type: 'string' - }] - }); - } - - async run(message, args) { - if (message.channel.type !== 'dm') { - if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; - } - const messageToReport = args.report; - const reportedMsg = await this.client.users.get(process.env.OWNER_ID).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`); - const successMsg = await message.say('Message Sent! Thanks for your support!'); - return [reportedMsg, successMsg]; - } -}; diff --git a/commands/games/lottery.js b/commands/games/lottery.js index 8e4fe5a2..2fce1b93 100644 --- a/commands/games/lottery.js +++ b/commands/games/lottery.js @@ -15,8 +15,9 @@ module.exports = class LotteryCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)]; - if (lotteryNumber !== 'Winner') return message.say(`Nope, sorry ${message.author.username}, you lost.`); - return message.say(`Wow ${message.author.username}! You actually won! Great job!`); + const lottery = ['Winner'][Math.floor(Math.random() * 100)]; + const userName = message.member ? message.member.displayName : message.author.username; + if (lottery !== 'Winner') return message.say(`Nope, sorry ${userName}, you lost.`); + return message.say(`Wow ${userName}! You actually won! Great job!`); } }; diff --git a/commands/games/mathgame.js b/commands/games/mathgame.js index b50f4db1..9b0a8a05 100644 --- a/commands/games/mathgame.js +++ b/commands/games/mathgame.js @@ -30,31 +30,31 @@ module.exports = class MathGameCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } const level = args.difficulty.toLowerCase(); - let randomType = ['+', '-', '*']; - randomType = randomType[Math.floor(Math.random() * randomType.length)]; - let randomValue; + let operation = ['+', '-', '*']; + operation = operation[Math.floor(Math.random() * operation.length)]; + let value; switch (level) { case 'easy': - randomValue = 10; + value = 10; break; case 'medium': - randomValue = 50; + value = 50; break; case 'hard': - randomValue = 100; + value = 100; break; case 'extreme': - randomValue = 1000; + value = 1000; break; } - const randomValue1 = Math.floor(Math.random() * randomValue) + 1; - const randomValue2 = Math.floor(Math.random() * randomValue) + 1; - const randomExpression = randomValue1 + randomType + randomValue2; - const solved = math.eval(randomExpression); + const value1 = Math.floor(Math.random() * value) + 1; + const value2 = Math.floor(Math.random() * value) + 1; + const expression = value1 + operation + value2; + const solved = math.eval(expression); const embed = new RichEmbed() .setTitle('You have **ten** seconds to answer:') - .setDescription(randomExpression); - const embedMsg = await message.embed(embed); + .setDescription(expression); + await message.embed(embed); try { const collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, { max: 1, @@ -62,15 +62,12 @@ module.exports = class MathGameCommand extends Command { errors: ['time'] }); if (collected.first().content !== solved.toString()) { - const loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); - return [embedMsg, loseMsg]; + return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); } - const victoryMsg = await message.say(`Good Job! You won! ${solved} is the correct answer!`); - return [embedMsg, victoryMsg]; + return message.say(`Good Job! You won! ${solved} is the correct answer!`); } catch (err) { - const loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); - return [embedMsg, loseMsg]; + return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); } } }; diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 30cd7ee2..44f9c3c6 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -28,11 +28,11 @@ module.exports = class QuizCommand extends Command { count: 1 }); const data = response.body[0]; - const answer = data.answer.toLowerCase().split('').join('').split('').join(''); + const answer = data.answer.toLowerCase().replace(/(|<\/i>)/g, ''); const embed = new RichEmbed() .setTitle('You have **fifteen** seconds to answer this question:') .setDescription(`**Category: ${data.category.title}**\n${data.question}`); - const embedMsg = await message.embed(embed); + await message.embed(embed); try { const collected = await message.channel.awaitMessages(res => res.author.id === message.author.id, { max: 1, @@ -40,15 +40,12 @@ module.exports = class QuizCommand extends Command { errors: ['time'] }); if (collected.first().content.toLowerCase() !== answer) { - const loseMsg = await message.say(`The correct answer is: ${answer}`); - return [embedMsg, loseMsg]; + return message.say(`The correct answer is: ${answer}`); } - const victoryMsg = await message.say(`The correct answer is: ${answer}`); - return [embedMsg, victoryMsg]; + return message.say(`Perfect! The correct answer is: ${answer}`); } catch (err) { - const loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`); - return [embedMsg, loseMsg]; + return message.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`); } } catch (err) { diff --git a/commands/games/typinggame.js b/commands/games/typinggame.js index 9418a974..03e63f17 100644 --- a/commands/games/typinggame.js +++ b/commands/games/typinggame.js @@ -29,8 +29,8 @@ module.exports = class TypingGameCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } const level = args.difficulty.toLowerCase(); - let randomSentence = ['The quick brown fox jumps over the lazy dog.', 'Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.', 'How razorback-jumping frogs can level six piqued gymnasts!', 'Amazingly few discotheques provide jukeboxes.']; - randomSentence = randomSentence[Math.floor(Math.random() * randomSentence.length)]; + let sentence = ['The quick brown fox jumps over the lazy dog.', 'Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.', 'How razorback-jumping frogs can level six piqued gymnasts!', 'Amazingly few discotheques provide jukeboxes.']; + sentence = sentence[Math.floor(Math.random() * sentence.length)]; let time; let levelWord; switch (level) { @@ -53,24 +53,21 @@ module.exports = class TypingGameCommand extends Command { } const embed = new RichEmbed() .setTitle(`You have **${levelWord}** seconds to type:`) - .setDescription(randomSentence); - const embedMsg = await message.embed(embed); + .setDescription(sentence); + await message.embed(embed); try { const collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, { max: 1, time: time, errors: ['time'] }); - if (collected.first().content !== randomSentence) { - const loseMsg = await message.say('Nope, your sentence does not match the original. Try again next time!'); - return [embedMsg, loseMsg]; + if (collected.first().content !== sentence) { + return message.say('Nope, your sentence does not match the original. Try again next time!'); } - const victoryMsg = await message.say(`Good Job! You won!`); - return [embedMsg, victoryMsg]; + return message.say(`Good Job! You won!`); } catch (err) { - const loseMsg = await message.say('Aw... Too bad, try again next time!'); - return [embedMsg, loseMsg]; + return message.say('Aw... Too bad, try again next time!'); } } }; diff --git a/commands/imageedit/meme.js b/commands/imageedit/meme.js index 789b27cc..d65e45a3 100644 --- a/commands/imageedit/meme.js +++ b/commands/imageedit/meme.js @@ -28,7 +28,7 @@ module.exports = class MemeCommand extends Command { prompt: 'What should the top row of the meme to be?', type: 'string', validate: toprow => { - if (toprow.match(/^[a-zA-Z0-9|.,!?'-\s]+$/) && toprow.length < 101) { + if (toprow.match(/^[a-zA-Z0-9.,!?'\s]+$/) && toprow.length < 101) { return true; } return 'Please do not use special characters and keep the rows under 100 characters each.'; @@ -38,7 +38,7 @@ module.exports = class MemeCommand extends Command { prompt: 'What should the bottom row of the meme to be?', type: 'string', validate: bottomrow => { - if (bottomrow.match(/^[a-zA-Z0-9|.,!?'-\s]+$/) && bottomrow.length < 101) { + if (bottomrow.match(/^[a-zA-Z0-9.,!?'\s]+$/) && bottomrow.length < 101) { return true; } return 'Please do not use special characters and keep the rows under 100 characters each.'; @@ -53,8 +53,10 @@ module.exports = class MemeCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!'); } const type = args.type.toLowerCase(); - const toprow = args.toprow.split(' ').join('-').split('?').join('~q'); - const bottomrow = args.bottomrow.split(' ').join('-').split('?').join('~q'); + const toprow = args.toprow.replace(/[ ]/g, '-'); + toprow = toprow.replace(/[?]/g, '~q'); + const bottomrow = args.bottomrow.replace(/[ ]/g, '-'); + bottomrow = bottomrow.replace(/[?]/g, '~q'); const link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`; return message.channel.sendFile(link).catch(() => message.say(':x: Error! Something went wrong!')); } diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 398b6e7b..34790c7c 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -43,18 +43,16 @@ module.exports = class BanCommand extends Command { if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!'); const member = args.member; const reason = args.reason; - if (!message.guild.member(member).bannable) return message.say(':x: Error! This member cannot be banned! Perhaps they have a higher role than me?'); + if (!member.bannable) return message.say(':x: Error! This member cannot be banned! Perhaps they have a higher role than me?'); try { - const banUser = await message.guild.member(member).ban(); - const okHandMsg = await message.say(':ok_hand:'); + await member.ban(); + await message.say(':ok_hand:'); const embed = new RichEmbed() .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setColor(0xFF0000) - .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() - .setDescription(`**Member:** ${banUser.user.username}#${banUser.user.discriminator} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`); - const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); - return [banUser, okHandMsg, modLogMsg]; + .setDescription(`**Member:** ${member.user.username}#${member.user.discriminator} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`); + return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 5cf41cae..452f7afc 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -40,18 +40,16 @@ module.exports = class KickCommand extends Command { if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!'); const member = args.member; const reason = args.reason; - if (!message.guild.member(member).bannable) return message.say(':x: Error! This member cannot be kicked! Perhaps they have a higher role than me?'); + if (!member.bannable) return message.say(':x: Error! This member cannot be kicked! Perhaps they have a higher role than me?'); try { - const kickUser = await message.guild.member(member).kick(); - const okHandMsg = await message.say(':ok_hand:'); + await member.kick(); + await message.say(':ok_hand:'); const embed = new RichEmbed() .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setColor(0xFFA500) - .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() - .setDescription(`**Member:** ${kickUser.user.username}#${kickUser.user.discriminator} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`); - const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); - return [kickUser, okHandMsg, modLogMsg]; + .setDescription(`**Member:** ${member.user.username}#${member.user.discriminator} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`); + return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index ecaeeebe..e392a574 100644 --- a/commands/moderation/lockdown.js +++ b/commands/moderation/lockdown.js @@ -31,19 +31,19 @@ module.exports = class LockdownCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'SEND_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR')) return message.say(':x: Error! I don\'t have the Administrator permission! This is not given by default, as that\'s quite bad practice. Please give it to me to use the lockdown command!'); } - const type = args.type; - if (type.toLowerCase() === 'start') { + const type = args.type.toLowerCase(); + if (type === 'start') { try { await message.channel.overwritePermissions(message.guild.defaultRole, { SEND_MESSAGES: false }); - return message.say('**Lockdown Started, users without Administrator can no longer post messages. Please use ;lockdown stop to end the lockdown.**'); + return message.say('**Lockdown Started, users without Administrator can no longer post messages. Please use `;lockdown stop` to end the lockdown.**'); } catch (err) { return message.say(':x: Error! Something went wrong!'); } } - if (type.toLowerCase() === 'stop') { + if (type === 'stop') { try { await message.channel.overwritePermissions(message.guild.defaultRole, { SEND_MESSAGES: true diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index a9502a2c..ca9745a0 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -51,18 +51,17 @@ module.exports = class UnbanCommand extends Command { const reason = args.reason; const bans = await message.guild.fetchBans(); if (!bans.has(memberID)) return message.say(':x: Error! Could not find this user in the bans.'); - const unbanUserObj = await bans.get(memberID); + const unbanUser = await bans.get(memberID); try { - const unbanUser = await message.guild.unban(unbanUserObj); - const okHandMsg = await message.say(':ok_hand:'); + await message.guild.unban(unbanUser); + await message.say(':ok_hand:'); const embed = new RichEmbed() .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setColor(0x00AE86) .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() .setDescription(`**Member:** ${unbanUser.username}#${unbanUser.discriminator} (${unbanUser.id})\n**Action:** Unban\n**Reason:** ${reason}`); - const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); - return [unbanUser, okHandMsg, modLogMsg]; + return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index f95ed8ad..a34d1147 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -36,19 +36,18 @@ module.exports = class WarnCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const userToWarn = args.member; + const member = args.member; const reason = args.reason; if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!'); try { - const okHandMsg = await message.say(':ok_hand:'); + await message.say(':ok_hand:'); const embed = new RichEmbed() .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setColor(0xFFFF00) .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() - .setDescription(`**Member:** ${userToWarn.user.username}#${userToWarn.user.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`); - const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); - return [okHandMsg, modLogMsg]; + .setDescription(`**Member:** ${member.user.username}#${member.user.discriminator} (${member.id})\n**Action:** Warn\n**Reason:** ${reason}`); + return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/numedit/roman.js b/commands/numedit/roman.js index 9b93aafa..f9553831 100644 --- a/commands/numedit/roman.js +++ b/commands/numedit/roman.js @@ -1,5 +1,5 @@ const { Command } = require('discord.js-commando'); -const romanNumeralConverter = require('roman-numeral-converter-mmxvi'); +const { getRomanFromInteger } = require('roman-numeral-converter-mmxvi'); module.exports = class RomanCommand extends Command { constructor(client) { @@ -27,8 +27,8 @@ module.exports = class RomanCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const numberToRoman = args.number; - const romanInterger = numberToRoman; - return message.say(romanNumeralConverter.getRomanFromInteger(romanInterger)); + const number = args.number; + const roman = getRomanFromInteger(number); + return message.say(roman); } }; diff --git a/commands/response/motivate.js b/commands/random/motivate.js similarity index 81% rename from commands/response/motivate.js rename to commands/random/motivate.js index 6316f40e..b5e8f5db 100644 --- a/commands/response/motivate.js +++ b/commands/random/motivate.js @@ -8,7 +8,7 @@ module.exports = class MotivateCommand extends Command { 'encourage', 'justdoit' ], - group: 'response', + group: 'random', memberName: 'motivate', description: 'Motivates someone. (;motivate @User)', examples: [';motivate @User'], @@ -25,7 +25,7 @@ module.exports = class MotivateCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const userToMotivate = args.thing || message.author; - return message.say(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`); + const motivated = args.thing || message.author; + return message.say(`${motivated}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`); } }; diff --git a/commands/response/cat.js b/commands/randomimg/cat.js similarity index 97% rename from commands/response/cat.js rename to commands/randomimg/cat.js index 8cc98633..1c811962 100644 --- a/commands/response/cat.js +++ b/commands/randomimg/cat.js @@ -4,7 +4,7 @@ module.exports = class CatCommand extends Command { constructor(client) { super(client, { name: 'cat', - group: 'response', + group: 'randomimg', memberName: 'cat', description: 'Sends a random cat picture. (;cat)', examples: [';cat'] diff --git a/commands/response/potato.js b/commands/randomimg/potato.js similarity index 96% rename from commands/response/potato.js rename to commands/randomimg/potato.js index 5d242112..eb956bbb 100644 --- a/commands/response/potato.js +++ b/commands/randomimg/potato.js @@ -7,7 +7,7 @@ module.exports = class PotatoCommand extends Command { aliases: [ 'tater' ], - group: 'response', + group: 'randomimg', memberName: 'potato', description: 'Sends a random Potato picture. (;potato)', examples: [';potato'] diff --git a/commands/response/pun.js b/commands/randomimg/pun.js similarity index 97% rename from commands/response/pun.js rename to commands/randomimg/pun.js index d33dba35..8c08124c 100644 --- a/commands/response/pun.js +++ b/commands/randomimg/pun.js @@ -4,7 +4,7 @@ module.exports = class RandomPunCommand extends Command { constructor(client) { super(client, { name: 'pun', - group: 'response', + group: 'randomimg', memberName: 'pun', description: 'Sends a random pun image. (;pun)', examples: [';pun'] diff --git a/commands/randomimg/vocaloid.js b/commands/randomimg/vocaloid.js new file mode 100644 index 00000000..dbb7b912 --- /dev/null +++ b/commands/randomimg/vocaloid.js @@ -0,0 +1,25 @@ +const { Command } = require('discord.js-commando'); + +module.exports = class VocaloidCommand extends Command { + constructor(client) { + super(client, { + name: 'vocaloid', + aliases: [ + 'vocaloidsong' + ], + group: 'randomimg', + memberName: 'vocaloid', + description: 'Sends a random VOCALOID song. (;vocaloid)', + examples: [';vocaloid'] + }); + } + + run(message) { + if (message.channel.type !== 'dm') { + if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; + } + let song = ['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']; + song = song[Math.floor(Math.random() * song.length)]; + return message.say(song); + } +}; diff --git a/commands/response/xiaopai.js b/commands/randomimg/xiaopai.js similarity index 66% rename from commands/response/xiaopai.js rename to commands/randomimg/xiaopai.js index eb1f1fd7..8f329291 100644 --- a/commands/response/xiaopai.js +++ b/commands/randomimg/xiaopai.js @@ -7,7 +7,7 @@ module.exports = class XiaoCommand extends Command { aliases: [ 'xiao' ], - group: 'response', + group: 'randomimg', memberName: 'xiaopai', description: 'Sends a random image of Xiao Pai. (;xiaopai)', examples: [';xiaopai'] @@ -19,8 +19,8 @@ module.exports = class XiaoCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!'); } - 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}`); + let xiao = ['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']; + xiao = xiao[Math.floor(Math.random() * xiao.length)]; + return message.channel.sendFile(`./images/Xiao${xiao}`); } }; diff --git a/commands/response/8ball.js b/commands/response/8ball.js index 791538ba..7bb8c0e7 100644 --- a/commands/response/8ball.js +++ b/commands/response/8ball.js @@ -21,8 +21,8 @@ module.exports = class MagicBallCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } const question = args.question; - let answers = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'You may rely on it', 'As I see it, yes', 'Most likely', 'Outlook good', 'Yes', 'Signs point to yes', 'Reply hazy try again', 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again', 'Don\'t count on it', 'My reply is no', 'My sources say no', 'Outlook not so good', 'Very doubtful']; - answers = answers[Math.floor(Math.random() * answers.length)]; - return message.say(`Question: ${question}\n:8ball: ${answers} :8ball:`); + let answer = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'You may rely on it', 'As I see it, yes', 'Most likely', 'Outlook good', 'Yes', 'Signs point to yes', 'Reply hazy try again', 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again', 'Don\'t count on it', 'My reply is no', 'My sources say no', 'Outlook not so good', 'Very doubtful']; + answer = answer[Math.floor(Math.random() * answer.length)]; + return message.say(`Question: ${question}\n:8ball: ${answer} :8ball:`); } }; diff --git a/commands/response/choose.js b/commands/response/choose.js index 7a748d85..4cb09aaa 100644 --- a/commands/response/choose.js +++ b/commands/response/choose.js @@ -24,8 +24,8 @@ module.exports = class ChooseCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - let choices = args.choices; - choices = choices[Math.floor(Math.random() * choices.length)]; - return message.say(`I choose ${choices}!`); + let choice = args.choices; + choice = choice[Math.floor(Math.random() * choice.length)]; + return message.say(`I choose ${choice}!`); } }; diff --git a/commands/response/compliment.js b/commands/response/compliment.js index b6433711..2995ec91 100644 --- a/commands/response/compliment.js +++ b/commands/response/compliment.js @@ -21,9 +21,9 @@ module.exports = class ComplimentCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToCompliment = args.thing || message.author; - 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)]; - return message.say(`${thingToCompliment}, ${compliments}`); + const complimented = args.thing || message.author; + let compliment = ['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.']; + compliment = compliment[Math.floor(Math.random() * compliment.length)]; + return message.say(`${complimented}, ${compliment}`); } }; diff --git a/commands/response/factcore.js b/commands/response/factcore.js index 87be0926..91be55ed 100644 --- a/commands/response/factcore.js +++ b/commands/response/factcore.js @@ -15,8 +15,8 @@ module.exports = class FactCoreCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - 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.say(facts); + let fact = ['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.']; + fact = fact[Math.floor(Math.random() * fact.length)]; + return message.say(fact); } }; diff --git a/commands/response/fortune.js b/commands/response/fortune.js index 8c59b58e..48d44759 100644 --- a/commands/response/fortune.js +++ b/commands/response/fortune.js @@ -18,8 +18,8 @@ module.exports = class FortuneCookieCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - 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.say(fortunes); + let fortune = ['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.']; + fortune = fortune[Math.floor(Math.random() * fortune.length)]; + return message.say(fortune); } }; diff --git a/commands/response/name.js b/commands/response/name.js index 460c6996..8017b6f0 100644 --- a/commands/response/name.js +++ b/commands/response/name.js @@ -30,18 +30,18 @@ module.exports = class RandomNameCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - let randomFirstMale = ['Bob', 'Daniel', 'Logan', 'Chris', 'Nathan', 'George', 'Mart', 'Charlie', 'Felix', 'Ralph', 'William', 'Max', 'Jerry', 'Marty', 'Joshua', 'Cody', 'Richard', 'Alex', 'Alexander', 'Jordan', 'Zachary', 'Bill', 'Alfred', 'Bruce', 'Caiden', 'Calvin', 'Eric', 'Robert', 'Mark', 'Miles', 'Nash', 'Ronald', 'Ivan', 'Edgar', 'Royal', 'Augustine', 'Dominic', 'Noel', 'Rocky', 'Grover', 'Paul', 'Jeremy', 'Stevie', 'Brock', 'Jc', 'Tony', 'Enoch', 'Zachery', 'Harvey', 'Gilbert', 'Chang', 'Emery', 'Carroll', 'Odell', 'Jean', 'Archie', 'Russ', 'Barry', 'Lowell', 'Jacob', 'Riku', 'Frederic', 'Levi', 'Faustino', 'Leland', 'Domenic', 'Irwin', 'Moises', 'Louie', 'Larry', 'Victor']; - randomFirstMale = randomFirstMale[Math.floor(Math.random() * randomFirstMale.length)]; - let randomFirstFemale = ['Elizabeth', 'Chelsey', 'Rachel', 'Logan', 'Alex', 'Jordan', 'Mary', 'Shirley', 'Sandy', 'Linda', 'Audrey', 'Autumn', 'Gracie', 'Grace', 'Erin', 'Catherine', 'Stephanie', 'Lucy', 'Patty', 'Julie', 'Christina', 'Fiona', 'Riley', 'Ashley', 'Bree', 'Lucila', 'Wendi', 'Evangelina', 'Ricki', 'Merna', 'Tegan', 'Venus', 'Claris', 'Tana', 'Sakura', 'Edythe', 'Adena', 'Princess', 'Elnora', 'Star', 'Edyth', 'Beverly', 'Kelsie', 'Letha', 'Latisha', 'Lolita', 'Bernandine', 'Jessenia', 'Hannah', 'Leonore', 'Alene', 'Fannie', 'Bernardine', 'Leena', 'Tera', 'Yvette', 'Melisa', 'Alissa', 'Xiao', 'Richelle', 'Bridgett', 'Sumiko', 'Paulette', 'Charlott', 'Honey', 'Veola', 'Sherita', 'Amanda', 'Vannessa', 'April', 'Ruth']; - randomFirstFemale = randomFirstFemale[Math.floor(Math.random() * randomFirstFemale.length)]; - let randomLast = ['Walker', 'Tworni', 'Ross', 'Smith', 'Odendahl', 'Deere', 'Brown', 'Williams', 'Jones', 'Miles', 'Moss', 'Roberto', 'McFly', 'McDonald', 'Lewis', 'Armstrong', 'Stevenson', 'Schwarzenegger', 'Robinson', 'Parker', 'Piper', 'Johnson', 'Brantley', 'Stewart', 'Ree', 'Talbot', 'Seville', 'Peace', 'Spielberg', 'Baggins', 'Wilborn', 'Vankirk', 'Shireman', 'Jimerson', 'Masters', 'Hack', 'Satcher', 'Younkin', 'Aguila', 'Duffey', 'Burgin', 'Highfall', 'Wee', 'Solari', 'Tomaselli', 'Basler', 'Difranco', 'Latch', 'Rives', 'Dolan', 'Abraham', 'Holter', 'Portugal', 'Lininger', 'Holst', 'Mccroy', 'Follmer', 'Hotchkiss', 'Gassaway', 'Wang', 'Agron', 'Raasch', 'Gourd', 'Czaja', 'Marquart', 'Papadopoulos', 'Ringer', 'Lax', 'Sperling', 'Galusha', 'Alston']; - randomLast = randomLast[Math.floor(Math.random() * randomLast.length)]; const gender = args.gender.toLowerCase(); + let lastName = ['Walker', 'Tworni', 'Ross', 'Smith', 'Odendahl', 'Deere', 'Brown', 'Williams', 'Jones', 'Miles', 'Moss', 'Roberto', 'McFly', 'McDonald', 'Lewis', 'Armstrong', 'Stevenson', 'Schwarzenegger', 'Robinson', 'Parker', 'Piper', 'Johnson', 'Brantley', 'Stewart', 'Ree', 'Talbot', 'Seville', 'Peace', 'Spielberg', 'Baggins', 'Wilborn', 'Vankirk', 'Shireman', 'Jimerson', 'Masters', 'Hack', 'Satcher', 'Younkin', 'Aguila', 'Duffey', 'Burgin', 'Highfall', 'Wee', 'Solari', 'Tomaselli', 'Basler', 'Difranco', 'Latch', 'Rives', 'Dolan', 'Abraham', 'Holter', 'Portugal', 'Lininger', 'Holst', 'Mccroy', 'Follmer', 'Hotchkiss', 'Gassaway', 'Wang', 'Agron', 'Raasch', 'Gourd', 'Czaja', 'Marquart', 'Papadopoulos', 'Ringer', 'Lax', 'Sperling', 'Galusha', 'Alston']; + lastName = lastName[Math.floor(Math.random() * lastName.length)]; if (gender === 'male') { - return message.say(`${randomFirstMale} ${randomLast}`); + let name = ['Bob', 'Daniel', 'Logan', 'Chris', 'Nathan', 'George', 'Mart', 'Charlie', 'Felix', 'Ralph', 'William', 'Max', 'Jerry', 'Marty', 'Joshua', 'Cody', 'Richard', 'Alex', 'Alexander', 'Jordan', 'Zachary', 'Bill', 'Alfred', 'Bruce', 'Caiden', 'Calvin', 'Eric', 'Robert', 'Mark', 'Miles', 'Nash', 'Ronald', 'Ivan', 'Edgar', 'Royal', 'Augustine', 'Dominic', 'Noel', 'Rocky', 'Grover', 'Paul', 'Jeremy', 'Stevie', 'Brock', 'Jc', 'Tony', 'Enoch', 'Zachery', 'Harvey', 'Gilbert', 'Chang', 'Emery', 'Carroll', 'Odell', 'Jean', 'Archie', 'Russ', 'Barry', 'Lowell', 'Jacob', 'Riku', 'Frederic', 'Levi', 'Faustino', 'Leland', 'Domenic', 'Irwin', 'Moises', 'Louie', 'Larry', 'Victor']; + name = name[Math.floor(Math.random() * name.length)]; + return message.say(`${name} ${lastName}`); } else if (gender === 'female') { - return message.say(`${randomFirstFemale} ${randomLast}`); + let name = ['Elizabeth', 'Chelsey', 'Rachel', 'Logan', 'Alex', 'Jordan', 'Mary', 'Shirley', 'Sandy', 'Linda', 'Audrey', 'Autumn', 'Gracie', 'Grace', 'Erin', 'Catherine', 'Stephanie', 'Lucy', 'Patty', 'Julie', 'Christina', 'Fiona', 'Riley', 'Ashley', 'Bree', 'Lucila', 'Wendi', 'Evangelina', 'Ricki', 'Merna', 'Tegan', 'Venus', 'Claris', 'Tana', 'Sakura', 'Edythe', 'Adena', 'Princess', 'Elnora', 'Star', 'Edyth', 'Beverly', 'Kelsie', 'Letha', 'Latisha', 'Lolita', 'Bernandine', 'Jessenia', 'Hannah', 'Leonore', 'Alene', 'Fannie', 'Bernardine', 'Leena', 'Tera', 'Yvette', 'Melisa', 'Alissa', 'Xiao', 'Richelle', 'Bridgett', 'Sumiko', 'Paulette', 'Charlott', 'Honey', 'Veola', 'Sherita', 'Amanda', 'Vannessa', 'April', 'Ruth']; + name = name[Math.floor(Math.random() * name.length)]; + return message.say(`${name} ${lastName}`); } } }; diff --git a/commands/response/ratewaifu.js b/commands/response/ratewaifu.js index e91f3ab5..42834d09 100644 --- a/commands/response/ratewaifu.js +++ b/commands/response/ratewaifu.js @@ -23,8 +23,8 @@ module.exports = class RateWaifuCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const waifuToRate = args.waifu; + const waifu = args.waifu; const rating = Math.floor(Math.random() * 10) + 1; - return message.say(`I'd give ${waifuToRate} a ${rating}/10!`); + return message.say(`I'd give ${waifu} a ${rating}/10!`); } }; diff --git a/commands/response/roast.js b/commands/response/roast.js index df198aae..8aec0035 100644 --- a/commands/response/roast.js +++ b/commands/response/roast.js @@ -24,14 +24,9 @@ module.exports = class RoastCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const userToRoast = args.thing || message.author; - 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 dollar 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); - } - else { - return message.say(`${userToRoast}, ${roasts}`); - } + const roasted = args.thing || message.author; + let roast = ['*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 dollar for every brain you don\'t have, I\'d have one dollar.', 'I\'d help you succeed but you\'re incapable.']; + roast = roast[Math.floor(Math.random() * roast.length)]; + return message.say(`${roasted}, ${roast}`); } }; diff --git a/commands/response/ship.js b/commands/response/ship.js index faac08e3..37515c69 100644 --- a/commands/response/ship.js +++ b/commands/response/ship.js @@ -23,8 +23,8 @@ module.exports = class ShipCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToShip = args.things; + const shipped = args.things; const percentage = Math.floor(Math.random() * 100) + 1; - return message.say(`I'd give ${thingToShip} a ${percentage}%!`); + return message.say(`I'd give ${shipped} a ${percentage}%!`); } }; diff --git a/commands/response/vocaloid.js b/commands/response/vocaloid.js deleted file mode 100644 index d0bfea27..00000000 --- a/commands/response/vocaloid.js +++ /dev/null @@ -1,25 +0,0 @@ -const { Command } = require('discord.js-commando'); - -module.exports = class VocaloidCommand extends Command { - constructor(client) { - super(client, { - name: 'vocaloid', - aliases: [ - 'vocaloidsong' - ], - group: 'response', - memberName: 'vocaloid', - description: 'Sends a random VOCALOID song. (;vocaloid)', - examples: [';vocaloid'] - }); - } - - run(message) { - if (message.channel.type !== 'dm') { - if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; - } - 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.say(songs); - } -}; diff --git a/commands/roleplay/cuddle.js b/commands/roleplay/cuddle.js index 5138fe13..370eb92e 100644 --- a/commands/roleplay/cuddle.js +++ b/commands/roleplay/cuddle.js @@ -20,7 +20,7 @@ module.exports = class CuddleCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *cuddles* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *cuddles* ${roleplayed}`); } }; diff --git a/commands/roleplay/divorce.js b/commands/roleplay/divorce.js index ca2f5d37..8b312521 100644 --- a/commands/roleplay/divorce.js +++ b/commands/roleplay/divorce.js @@ -20,7 +20,7 @@ module.exports = class DivorceCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *divorces* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *divorces* ${roleplayed}`); } }; diff --git a/commands/roleplay/eat.js b/commands/roleplay/eat.js index f70eff7c..262028f5 100644 --- a/commands/roleplay/eat.js +++ b/commands/roleplay/eat.js @@ -20,7 +20,7 @@ module.exports = class EatCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *eats* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *eats* ${roleplayed}`); } }; diff --git a/commands/roleplay/falconpunch.js b/commands/roleplay/falconpunch.js index c50d6b21..f1649965 100644 --- a/commands/roleplay/falconpunch.js +++ b/commands/roleplay/falconpunch.js @@ -20,7 +20,7 @@ module.exports = class FalconPunchCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *falcon punches* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *falcon punches* ${roleplayed}`); } }; diff --git a/commands/roleplay/fistbump.js b/commands/roleplay/fistbump.js index 274e8a03..befdc9ec 100644 --- a/commands/roleplay/fistbump.js +++ b/commands/roleplay/fistbump.js @@ -20,7 +20,7 @@ module.exports = class FistBumpCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *fist-bumps* ${thingToRoleplay} *badalalala*`); + const roleplayed = args.thing; + return message.say(`${message.author} *fist-bumps* ${roleplayed} *badalalala*`); } }; diff --git a/commands/roleplay/highfive.js b/commands/roleplay/highfive.js index 787c0f42..98bc81ad 100644 --- a/commands/roleplay/highfive.js +++ b/commands/roleplay/highfive.js @@ -20,7 +20,7 @@ module.exports = class HighFivesCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *high-fives* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *high-fives* ${roleplayed}`); } }; diff --git a/commands/roleplay/hitwithshovel.js b/commands/roleplay/hitwithshovel.js index 82669a50..36b93e1f 100644 --- a/commands/roleplay/hitwithshovel.js +++ b/commands/roleplay/hitwithshovel.js @@ -20,7 +20,7 @@ module.exports = class HitwithShovelCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *hits* ${thingToRoleplay} *with a shovel*`); + const roleplayed = args.thing; + return message.say(`${message.author} *hits* ${roleplayed} *with a shovel*`); } }; diff --git a/commands/roleplay/hug.js b/commands/roleplay/hug.js index 6e76de12..8a5e71cd 100644 --- a/commands/roleplay/hug.js +++ b/commands/roleplay/hug.js @@ -20,7 +20,7 @@ module.exports = class HugCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *hugs* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *hugs* ${roleplayed}`); } }; diff --git a/commands/roleplay/inhales.js b/commands/roleplay/inhales.js index 80252146..5da7180d 100644 --- a/commands/roleplay/inhales.js +++ b/commands/roleplay/inhales.js @@ -20,7 +20,7 @@ module.exports = class InhaleCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *inhales* ${thingToRoleplay} *but gained no ability...*`); + const roleplayed = args.thing; + return message.say(`${message.author} *inhales* ${roleplayed} *but gained no ability...*`); } }; diff --git a/commands/roleplay/kill.js b/commands/roleplay/kill.js index 4af6681c..da519eef 100644 --- a/commands/roleplay/kill.js +++ b/commands/roleplay/kill.js @@ -20,7 +20,7 @@ module.exports = class KillCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *kills* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *kills* ${roleplayed}`); } }; diff --git a/commands/roleplay/kiss.js b/commands/roleplay/kiss.js index fdd194f7..03ee6a5e 100644 --- a/commands/roleplay/kiss.js +++ b/commands/roleplay/kiss.js @@ -20,7 +20,7 @@ module.exports = class KissCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *kisses* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *kisses* ${roleplayed}`); } }; diff --git a/commands/roleplay/marries.js b/commands/roleplay/marries.js index 0e3d7597..0ef29d94 100644 --- a/commands/roleplay/marries.js +++ b/commands/roleplay/marries.js @@ -20,7 +20,7 @@ module.exports = class MarryCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *marries* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *marries* ${roleplayed}`); } }; diff --git a/commands/roleplay/pat.js b/commands/roleplay/pat.js index 2d696df9..f2cc31eb 100644 --- a/commands/roleplay/pat.js +++ b/commands/roleplay/pat.js @@ -20,7 +20,7 @@ module.exports = class PatCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *pats* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *pats* ${roleplayed}`); } }; diff --git a/commands/roleplay/poke.js b/commands/roleplay/poke.js index 871ab655..3b4cfcce 100644 --- a/commands/roleplay/poke.js +++ b/commands/roleplay/poke.js @@ -20,7 +20,7 @@ module.exports = class PokeCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *pokes* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *pokes* ${roleplayed}`); } }; diff --git a/commands/roleplay/punch.js b/commands/roleplay/punch.js index 6755b6e3..ab4faed6 100644 --- a/commands/roleplay/punch.js +++ b/commands/roleplay/punch.js @@ -20,7 +20,7 @@ module.exports = class PunchCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *punches* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *punches* ${roleplayed}`); } }; diff --git a/commands/roleplay/slap.js b/commands/roleplay/slap.js index 25508285..af4baf7d 100644 --- a/commands/roleplay/slap.js +++ b/commands/roleplay/slap.js @@ -20,7 +20,7 @@ module.exports = class SlapCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToRoleplay = args.thing; - return message.say(`${message.author} *slaps* ${thingToRoleplay}`); + const roleplayed = args.thing; + return message.say(`${message.author} *slaps* ${roleplayed}`); } }; diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index 12002b42..ae6bc2dd 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -27,10 +27,10 @@ module.exports = class BotSearchCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const botToFind = args.bot.id; + const bot = args.bot.id; try { const response = await request - .get(`https://bots.discord.pw/api/bots/${botToFind}`) + .get(`https://bots.discord.pw/api/bots/${bot}`) .set({ 'Authorization': process.env.DISCORD_BOTS_KEY }); diff --git a/commands/search/define.js b/commands/search/define.js index 94950a55..9d992dfb 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -29,10 +29,10 @@ module.exports = class DefineCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const defineThis = encodeURI(args.word); + const word = encodeURI(args.word); try { const response = await request - .get(`http://api.wordnik.com:80/v4/word.json/${defineThis}/definitions`) + .get(`http://api.wordnik.com:80/v4/word.json/${word}/definitions`) .query({ limit: 1, includeRelated: false, diff --git a/commands/search/discrim.js b/commands/search/discrim.js index bdee950a..ab903d55 100644 --- a/commands/search/discrim.js +++ b/commands/search/discrim.js @@ -32,10 +32,10 @@ module.exports = class DiscrimCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const userToSearch = args.discrim; - const users = await this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort(); + const discrim = args.discrim; + const users = await this.client.users.filter(u => u.discriminator === discrim).map(u => u.username).sort(); const embed = new RichEmbed() - .setTitle(`${users.length} Users with the discriminator: ${userToSearch}`) + .setTitle(`${users.length} Users with the discriminator: ${discrim}`) .setDescription(users.join(', ')); return message.embed(embed); } diff --git a/commands/search/forecast.js b/commands/search/forecast.js index c1e37b58..20e6f64b 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -26,12 +26,12 @@ module.exports = class ForecastCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const locationToSearch = args.locationQ; + const location = args.locationQ; try { const response = await request .get('https://query.yahooapis.com/v1/public/yql') .query({ - q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")`, + q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${location}")`, format: 'json' }); const info = response.body.query.results.channel; diff --git a/commands/search/google.js b/commands/search/google.js index 0d3d0e80..b1808ee7 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -26,21 +26,21 @@ module.exports = class GoogleCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToSearch = args.query; - const searchMsg = await message.say('Searching...'); + const query = args.query; + const msg = await message.say('Searching...'); try { const response = await request .get(`https://www.google.com/search`) .query({ - q: thingToSearch + q: query }); const $ = cheerio.load(response.text); let href = $('.r').first().find('a').first().attr('href'); href = querystring.parse(href.replace('/url?', '')); - return searchMsg.edit(href.q); + return msg.edit(href.q); } catch (err) { - return searchMsg.edit(':x: Error! No Results Found!'); + return msg.edit(':x: Error! No Results Found!'); } } }; diff --git a/commands/search/imdb.js b/commands/search/imdb.js index f4b3d244..30e61457 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -28,12 +28,12 @@ module.exports = class IMDBCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const queryMovie = args.movie; + const movie = args.movie; try { const response = await request .get(`http://www.omdbapi.com/`) .query({ - t: queryMovie, + t: movie, plot: 'full' }); const data = response.body; diff --git a/commands/search/osu.js b/commands/search/osu.js index 0a44b657..5a305e66 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -28,13 +28,13 @@ module.exports = class OsuCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const usernameToSearch = args.username; + const username = args.username; try { const response = await request .get('https://osu.ppy.sh/api/get_user') .query({ k: process.env.OSU_KEY, - u: usernameToSearch, + u: username, type: 'string' }); const data = response.body[0]; diff --git a/commands/search/urban.js b/commands/search/urban.js index 758a2355..b728ac70 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -28,12 +28,12 @@ module.exports = class UrbanCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const wordToDefine = args.word; + const word = args.word; try { const response = await request .get('http://api.urbandictionary.com/v0/define') .query({ - term: wordToDefine + term: word }); const data = response.body.list[0]; const embed = new RichEmbed() diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index e0c230da..5d432fda 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -23,7 +23,7 @@ module.exports = class WattpadCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const queryBook = args.book; + const book = args.book; try { const response = await request .get('https://api.wattpad.com:443/v4/stories') @@ -31,7 +31,7 @@ module.exports = class WattpadCommand extends Command { 'Authorization': `Basic ${process.env.WATTPAD_KEY}` }) .query({ - query: queryBook, + query: book, limit: 1 }); const data = response.body.stories[0]; diff --git a/commands/search/weather.js b/commands/search/weather.js index b1263b66..70df48bc 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -23,12 +23,12 @@ module.exports = class WeatherCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const locationToSearch = args.locationQ; + const location = args.locationQ; try { const response = await request .get('https://query.yahooapis.com/v1/public/yql') .query({ - q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")`, + q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${location}")`, format: 'json' }); const data = response.body.query.results.channel; diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 6bfbf9de..0bc5185e 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -23,8 +23,8 @@ module.exports = class WikipediaCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const thingToSearch = args.query.split(')').join('%29'); - const title = encodeURI(thingToSearch); + const query = args.query.replace(/[)]/g, '%29'); + const title = encodeURI(query); try { const response = await request .get(`https://en.wikipedia.org/w/api.php`) @@ -32,7 +32,7 @@ module.exports = class WikipediaCommand extends Command { action: 'query', prop: 'extracts', format: 'json', - titles: thingToSearch, + titles: query, exintro: '', explaintext: '', redirects: '', diff --git a/commands/search/youtube.js b/commands/search/youtube.js index a6f5e275..6b534f83 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -26,7 +26,7 @@ module.exports = class YouTubeCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const videoToSearch = args.video; + const video = args.video; try { const response = await request .get('https://www.googleapis.com/youtube/v3/search') @@ -34,7 +34,7 @@ module.exports = class YouTubeCommand extends Command { part: 'snippet', type: 'video', maxResults: 1, - q: videoToSearch, + q: video, key: process.env.YOUTUBE_KEY }); const data = response.body.items[0]; diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index 651b8fb2..c2e25a18 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -23,10 +23,10 @@ module.exports = class YuGiOhCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const cardName = encodeURI(args.card); + const card = encodeURI(args.card); try { const response = await request - .get(`http://yugiohprices.com/api/card_data/${cardName}`); + .get(`http://yugiohprices.com/api/card_data/${card}`); const data = response.body.data; if (data.card_type === 'monster') { const embed = new RichEmbed() diff --git a/commands/textedit/binary.js b/commands/textedit/binary.js index 29d47e6d..2643bcca 100644 --- a/commands/textedit/binary.js +++ b/commands/textedit/binary.js @@ -27,8 +27,8 @@ module.exports = class BinaryCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const turnToBinary = args.text; - const binaryText = stringToBinary(turnToBinary); - return message.say(binaryText); + const text = args.text; + const binary = stringToBinary(text); + return message.say(binary); } }; diff --git a/commands/textedit/cowsay.js b/commands/textedit/cowsay.js index 596b7884..96ed7555 100644 --- a/commands/textedit/cowsay.js +++ b/commands/textedit/cowsay.js @@ -21,9 +21,9 @@ module.exports = class CowsayCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const turnToCowsay = args.text; + const text = args.text; return message.code(null, cowsay.say({ - text: turnToCowsay, + text: text, e: 'oO', T: 'U ' })).catch(() => message.say(':x: Error! Perhaps the content is too long?')); diff --git a/commands/textedit/embed.js b/commands/textedit/embed.js index f453413f..6a726422 100644 --- a/commands/textedit/embed.js +++ b/commands/textedit/embed.js @@ -24,12 +24,12 @@ module.exports = class EmbedCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!'); } - const embedMessage = args.text; + const text = args.text; const embed = new RichEmbed() .setAuthor(message.author.username, message.author.avatarURL) .setColor(0x00AE86) .setTimestamp() - .setDescription(embedMessage); + .setDescription(text); await message.delete(); return message.embed(embed); } diff --git a/commands/textedit/morse.js b/commands/textedit/morse.js index e3d55b30..3582d9ca 100644 --- a/commands/textedit/morse.js +++ b/commands/textedit/morse.js @@ -30,8 +30,8 @@ module.exports = class MorseCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const toMorse = args.text; - const morseEncoded = morse.encode(toMorse); - return message.say(morseEncoded); + const text = args.text; + const encoded = morse.encode(text); + return message.say(encoded); } }; diff --git a/commands/textedit/pirate.js b/commands/textedit/pirate.js index a14f62c1..9ca6093f 100644 --- a/commands/textedit/pirate.js +++ b/commands/textedit/pirate.js @@ -31,9 +31,8 @@ module.exports = class PirateCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const turnToPirate = args.text; - const pirate = pirateSpeak.translate(turnToPirate); - if (pirate.length > 1950) return message.say(':x: Error! Your message is too long!'); + const text = args.text; + const pirate = pirateSpeak.translate(text); return message.say(`\u180E${pirate}`); } }; diff --git a/commands/textedit/reverse.js b/commands/textedit/reverse.js index e9697fe1..efcaafd5 100644 --- a/commands/textedit/reverse.js +++ b/commands/textedit/reverse.js @@ -20,8 +20,8 @@ module.exports = class ReverseCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const stringToReverse = args.text; - const reversed = stringToReverse.split('').reverse().join(''); + const text = args.text; + const reversed = text.split('').reverse().join(''); return message.say(`\u180E${reversed}`); } }; diff --git a/commands/textedit/romaji.js b/commands/textedit/romaji.js index 767c8ba9..91c07757 100644 --- a/commands/textedit/romaji.js +++ b/commands/textedit/romaji.js @@ -33,8 +33,8 @@ module.exports = class RomajiCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const romajify = args.kana; - const romajified = hepburn.fromKana(romajify); - return message.say(romajified); + const kana = args.kana; + const romaji = hepburn.fromKana(kana); + return message.say(romaji); } }; diff --git a/commands/textedit/say.js b/commands/textedit/say.js index 560d82ea..7c23902f 100644 --- a/commands/textedit/say.js +++ b/commands/textedit/say.js @@ -28,8 +28,8 @@ module.exports = class SayCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!'); } - const copycat = args.text; + const text = args.text; await message.delete(); - return message.say(`\u180E${copycat}`); + return message.say(`\u180E${text}`); } }; diff --git a/commands/textedit/shuffle.js b/commands/textedit/shuffle.js index 3ecb6a0b..ad277b1e 100644 --- a/commands/textedit/shuffle.js +++ b/commands/textedit/shuffle.js @@ -32,7 +32,8 @@ module.exports = class ShuffleCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToShuffle = args.text; - return message.say(`\u180E${thingToShuffle.shuffle()}`); + const text = args.text; + const shuffled = text.shuffle(); + return message.say(`\u180E${shuffled}`); } }; diff --git a/commands/textedit/temmie.js b/commands/textedit/temmie.js index 5048b817..a90f86ae 100644 --- a/commands/textedit/temmie.js +++ b/commands/textedit/temmie.js @@ -27,8 +27,8 @@ module.exports = class TemmieCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const thingToTranslate = args.text; - const temmized = temmize(thingToTranslate); + const text = args.text; + const temmized = temmize(text); return message.say(`\u180E${temmized}`); } }; diff --git a/commands/textedit/temmize.js b/commands/textedit/temmize.js index 7e27427f..681f7dc2 100644 --- a/commands/textedit/temmize.js +++ b/commands/textedit/temmize.js @@ -232,7 +232,7 @@ const dictionary = { }; function translateWord(word) { - let wordTranslate = dictionary[word.toLowerCase()]; + var wordTranslate = dictionary[word.toLowerCase()]; if (wordTranslate === undefined) return word; else return applyCase(word, wordTranslate); } @@ -241,8 +241,8 @@ function applyCase(wordA, wordB) { if (wordA.length === 1 && wordB.length !== 1) return wordB; if (wordA === wordA.toUpperCase()) return wordB.toUpperCase(); if (wordA === wordA.toLowerCase()) return wordB.toLowerCase(); - let firstChar = wordA.slice(0, 1); - let otherChars = wordA.slice(1); + var firstChar = wordA.slice(0, 1); + var otherChars = wordA.slice(1); if (firstChar === firstChar.toUpperCase() && otherChars === otherChars.toLowerCase()) { return wordB.slice(0, 1).toUpperCase() + wordB.slice(1).toLowerCase(); } @@ -255,16 +255,16 @@ function isLetter(character) { } function translator(text) { - let translatedText = ''; - let word = ''; - for (let i = 0; i < text.length; i += 1) { - let character = text[i]; + var translatedText = ''; + var word = ''; + for (var i = 0; i < text.length; i += 1) { + var character = text[i]; if (isLetter(character)) { word += character; } else { if (word != '') { - let wordTranslate = translateWord(word); + var wordTranslate = translateWord(word); translatedText += wordTranslate; word = ''; } @@ -278,8 +278,10 @@ function translator(text) { } module.exports = function(text) { - let currentTranslation = translator(text); - let temmify = currentTranslation.split('ing').join('in').split('!').join('!!!!111!11!1!!!1!!!1111!').split("'").join(''); + const currentTranslation = translator(text); + let temmify = currentTranslation.replace(/[ing]/g, 'in'); + temmify = temmify.replace(/[!]/g, '!!!!111!11!1!!!1!!!1111!'); + temmify - temmify.replace(/[']/g, ''); return temmify; }; diff --git a/commands/textedit/translate.js b/commands/textedit/translate.js index a1a0057f..5df1a50e 100644 --- a/commands/textedit/translate.js +++ b/commands/textedit/translate.js @@ -135,14 +135,14 @@ module.exports = class TranslateCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const languageto = args.to.toLowerCase(); + const language = args.to.toLowerCase(); const query = args.text; try { const response = await request .get(`https://translate.yandex.net/api/v1.5/tr.json/translate`) .query({ key: process.env.YANDEX_KEY, - lang: languageto, + lang: language, text: query }); const data = response.body; diff --git a/commands/textedit/webhook.js b/commands/textedit/webhook.js index e98b36b2..99cf94ab 100644 --- a/commands/textedit/webhook.js +++ b/commands/textedit/webhook.js @@ -30,13 +30,13 @@ module.exports = class WebhookCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!'); } - const content = args.text; + const text = args.text; try { await message.delete(); await request .post(process.env.WEBHOOK_URL) .send({ - content: content + content: text }); return null; } diff --git a/commands/textedit/yoda.js b/commands/textedit/yoda.js index b4723c28..abd4345e 100644 --- a/commands/textedit/yoda.js +++ b/commands/textedit/yoda.js @@ -21,7 +21,7 @@ module.exports = class YodaCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const turnToYoda = args.text; + const text = args.text; try { const response = await request .get('https://yoda.p.mashape.com/yoda') @@ -30,7 +30,7 @@ module.exports = class YodaCommand extends Command { 'Accept': 'text/plain' }) .query({ - sentence: turnToYoda + sentence: text }); return message.say(`\u180E${response.text}`); } diff --git a/commands/textedit/zalgo.js b/commands/textedit/zalgo.js index 27fe264a..ef58a4b1 100644 --- a/commands/textedit/zalgo.js +++ b/commands/textedit/zalgo.js @@ -27,7 +27,8 @@ module.exports = class ZalgoCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const zalgoified = zalgo(args.text); + const text = args.text; + const zalgoified = zalgo(text); return message.say(`\u180E${zalgoified}`); } }; diff --git a/commands/botinfo/info.js b/commands/util/info.js similarity index 98% rename from commands/botinfo/info.js rename to commands/util/info.js index be43baaa..34f63f45 100644 --- a/commands/botinfo/info.js +++ b/commands/util/info.js @@ -12,7 +12,7 @@ module.exports = class InfoCommand extends Command { 'data', 'information' ], - group: 'botinfo', + group: 'util', memberName: 'info', description: 'Gives some bot info for your shard. (;info)', examples: [';info'] @@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command { .addField('Shards', `${this.client.options.shardCount} (${this.client.shard.id})`, true) .addField('Commands', - '114', true) + '112', true) .addField('Owner', 'dragonfire535#8081', true) .addField('Source Code', diff --git a/commands/botinfo/invite.js b/commands/util/invite.js similarity index 96% rename from commands/botinfo/invite.js rename to commands/util/invite.js index ee6b5bfe..141ad307 100644 --- a/commands/botinfo/invite.js +++ b/commands/util/invite.js @@ -4,7 +4,7 @@ module.exports = class InviteCommand extends Command { constructor(client) { super(client, { name: 'invite', - group: 'botinfo', + group: 'util', memberName: 'invite', description: 'Sends you an invite for the bot and an invite to my server. (;invite)', examples: [';invite'] diff --git a/commands/util/sendDM.js b/commands/util/sendDM.js deleted file mode 100644 index b32b499f..00000000 --- a/commands/util/sendDM.js +++ /dev/null @@ -1,50 +0,0 @@ -const { Command } = require('discord.js-commando'); - -module.exports = class SendDMCommand extends Command { - constructor(client) { - super(client, { - name: 'senddm', - aliases: [ - 'dm', - 'recontact' - ], - group: 'util', - memberName: 'senddm', - description: 'Sends a DM to a user ID.', - examples: [';senddm 278305350804045834 This is a DM.'], - args: [{ - key: 'userid', - prompt: 'What is the User ID of the user you wish to contact?', - type: 'string', - validate: userID => { - if (userID.length === 18) { - return true; - } - return 'Invalid ID.'; - } - }, { - key: 'content', - prompt: 'What would you like the content of the message to be?', - type: 'string' - }] - }); - } - hasPermission(msg) { - return this.client.isOwner(msg.author); - } - - async run(message, args) { - if (message.channel.type !== 'dm') { - if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; - } - const userID = args.userid; - const content = args.content; - try { - await this.client.users.get(userID).send(content); - return message.say('Success!'); - } - catch (err) { - return message.say(':x: Error! Something went wrong!'); - } - } -}; diff --git a/commands/util/servers.js b/commands/util/servers.js index 8b0a13f0..e9ef308f 100644 --- a/commands/util/servers.js +++ b/commands/util/servers.js @@ -9,7 +9,7 @@ module.exports = class ServersCommand extends Command { ], group: 'util', memberName: 'servers', - description: 'Sends a list of all server names and IDs to the log.', + description: 'Sends a list of all server names and IDs to the log. (;servers)', examples: [';servers'] }); } diff --git a/commands/botinfo/shardinfo.js b/commands/util/shardinfo.js similarity index 87% rename from commands/botinfo/shardinfo.js rename to commands/util/shardinfo.js index 6888e442..dfd6a42e 100644 --- a/commands/botinfo/shardinfo.js +++ b/commands/util/shardinfo.js @@ -11,12 +11,13 @@ module.exports = class ShardInfoCommand extends Command { aliases: [ 'shard-info', 'shard-data', - 'sharddata' + 'sharddata', + 'shard' ], - group: 'botinfo', + group: 'util', memberName: 'shardinfo', - description: 'Gives some bot info for the Shard you specify. (;info 0)', - examples: [';info 0'], + description: 'Gives some bot info for the Shard you specify. (;shardinfo 0)', + examples: [';shardinfo 0'], args: [{ key: 'shardID', prompt: 'Which Shard would you like to get data for?', @@ -40,15 +41,15 @@ module.exports = class ShardInfoCommand extends Command { const embed = new RichEmbed() .setColor(0x00AE86) .addField('Servers', - `${guilds[shardID]} / ${guilds.reduce((prev, val) => prev + val, 0)}`, true) - .addField('Shards', - `${this.client.options.shardCount} (${shardID})`, true) - .addField('Version', - version, true) + guilds[shardID], true) + .addField('Shard ID', + shardID, true) .addField('Memory Usage', `${memory[shardID]}MB`, true) .addField('Uptime', moment.duration(uptime[shardID]).format('d[d]h[h]m[m]s[s]'), true) + .addField('Version', + version, true) .addField('Node Version', process.version, true); return message.embed(embed); diff --git a/commands/botinfo/uptime.js b/commands/util/uptime.js similarity index 86% rename from commands/botinfo/uptime.js rename to commands/util/uptime.js index c0a59e01..c7294d09 100644 --- a/commands/botinfo/uptime.js +++ b/commands/util/uptime.js @@ -6,7 +6,7 @@ module.exports = class UptimeCommand extends Command { constructor(client) { super(client, { name: 'uptime', - group: 'botinfo', + group: 'util', memberName: 'uptime', description: 'Displays how long the bot has been active. (;uptime)', examples: [';uptime'] @@ -17,6 +17,6 @@ module.exports = class UptimeCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - return message.say(`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.**`); + return message.say(`I've been active on this shard for: **${moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]')}**!`); } }; diff --git a/html/carbondesc.html b/html/carbondesc.html index 639ef163..5590cb9d 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -53,7 +53,7 @@

Information

diff --git a/html/discordbots.html b/html/discordbots.html index 1324c002..039ede33 100644 --- a/html/discordbots.html +++ b/html/discordbots.html @@ -102,7 +102,7 @@

Information

diff --git a/index.js b/index.js index 20b26976..81f37b6d 100644 --- a/index.js +++ b/index.js @@ -1,21 +1,21 @@ const commando = require('discord.js-commando'); const request = require('superagent'); +const path = require('path'); const client = new commando.Client({ commandPrefix: ';', unknownCommandResponse: false, owner: process.env.OWNER_ID, disableEveryone: true }); -const path = require('path'); client.registry .registerDefaultTypes() .registerGroups([ - ['botinfo', 'Bot Info'], ['userinfo', 'User Info'], ['guildinfo', 'Server Info'], ['moderation', 'Moderation'], ['response', 'Random Response'], + ['randomimg', 'Random Image'], ['avataredit', 'Avatar Manipulation'], ['textedit', 'Text Manipulation'], ['numedit', 'Number Manipulation'], @@ -33,9 +33,9 @@ client.registry client.on('guildCreate', async(guild) => { console.log(`[Guild] I have joined the guild: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})!`); - const results = await client.shard.fetchClientValues('guilds.size'); - const count = results.reduce((prev, val) => prev + val, 0); - console.log(`[Guild Count] ${count}`); + const guilds = await client.shard.fetchClientValues('guilds.size'); + const count = guilds.reduce((prev, val) => prev + val, 0); + console.log(`[Count] ${count}`); try { const response = await request .post('https://www.carbonitex.net/discord/data/botdata.php') @@ -66,9 +66,9 @@ client.on('guildCreate', async(guild) => { client.on('guildDelete', async(guild) => { console.log(`[Guild] I have left the guild: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})...`); - const results = await client.shard.fetchClientValues('guilds.size'); - const count = results.reduce((prev, val) => prev + val, 0); - console.log(`[Guild Count] ${count}`); + const guilds = await client.shard.fetchClientValues('guilds.size'); + const count = guilds.reduce((prev, val) => prev + val, 0); + console.log(`[Count] ${count}`); try { const response = await request .post('https://www.carbonitex.net/discord/data/botdata.php') @@ -97,13 +97,14 @@ client.on('guildDelete', async(guild) => { } }); -client.on('disconnect', () => { +client.on('disconnect', (event) => { + console.log(`[Disconnect] The Shard ${client.shard.id} disconnected with Code ${event.code}.`); process.exit(0); }); -client.once('ready', () => { - console.log('[Ready] Logged in!'); - client.user.setGame(';help | dragonfire535'); +client.on('ready', () => { + console.log(`[Ready] Shard ${client.shard.id} Logged in!`); + client.user.setGame(`;help | Shard ${client.shard.id}`); }); process.on('unhandledRejection', console.error);