diff options
| author | Justin <jtsshieh@outlook.com> | 2019-11-02 11:02:19 -0400 |
|---|---|---|
| committer | Justin <jtsshieh@outlook.com> | 2019-11-02 11:02:19 -0400 |
| commit | 7031fa12ba79281edc49df972311c13ad0e8fa53 (patch) | |
| tree | 60410a33fe45add85a9dc962c975be478f3f8cff /commands/Fun | |
| parent | 106530d5dc53166632a6a0ecc8930eb2b1ed4bfd (diff) | |
| download | PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.gz PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.bz2 PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.zip | |
es-lint settings added + linted all files
Diffstat (limited to 'commands/Fun')
| -rw-r--r-- | commands/Fun/8ball.js | 14 | ||||
| -rw-r--r-- | commands/Fun/balance.js | 6 | ||||
| -rw-r--r-- | commands/Fun/cureboredom.js | 10 | ||||
| -rw-r--r-- | commands/Fun/findmyphone.js | 6 | ||||
| -rw-r--r-- | commands/Fun/gamble.js | 62 | ||||
| -rw-r--r-- | commands/Fun/jobs.js | 43 | ||||
| -rw-r--r-- | commands/Fun/og151.js | 6 | ||||
| -rw-r--r-- | commands/Fun/ship.js | 6 | ||||
| -rw-r--r-- | commands/Fun/story.js | 38 |
9 files changed, 106 insertions, 85 deletions
diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index 48f53e0..23846a3 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -7,8 +7,10 @@ * * *************************************/ -exports.run = async (bot, msg, args) => { - if (args.length < 1) return msg.reply('You need to ask the 8-ball something for it to respond!'); +exports.run = (bot, msg, args) => { + if (args.length < 1) { + return msg.reply('You need to ask the 8-ball something for it to respond!'); + } const responses = [ 'May the odds ever be in your favor...', @@ -38,19 +40,19 @@ exports.run = async (bot, msg, args) => { 'My reply is no', 'My sources say no', 'Outlook not so good', - 'Very doubtful', + 'Very doubtful' ]; - msg.channel.send(':8ball: *' + (responses[Math.floor(Math.random() * responses.length)]) + '*'); + msg.channel.send(`:8ball: *${responses[Math.floor(Math.random() * responses.length)]}*`); }; exports.conf = { aliases: ['ask'], - guildOnly: true, + guildOnly: true }; exports.help = { name: '8ball', description: 'Ask the magic 8-ball something. It will answer back, and be as much of a smart-alac as it wants to.', - usage: '<...question>', + usage: '<...question>' }; diff --git a/commands/Fun/balance.js b/commands/Fun/balance.js index afe094e..1a7995b 100644 --- a/commands/Fun/balance.js +++ b/commands/Fun/balance.js @@ -9,15 +9,15 @@ exports.run = async (bot, msg) => { const credits = await bot.plugins.economy.get(msg.author.id); - msg.reply(credits + ' credits'); + msg.reply(`${credits} credits`); }; exports.conf = { aliases: ['bal', 'money', 'credits'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'balance', - description: 'Check your balance!', + description: 'Check your balance!' }; diff --git a/commands/Fun/cureboredom.js b/commands/Fun/cureboredom.js index 4b99406..f9ae256 100644 --- a/commands/Fun/cureboredom.js +++ b/commands/Fun/cureboredom.js @@ -26,20 +26,22 @@ exports.run = (bot, msg, args) => { 'Messing with Rich Presence :gear:', 'Making videos :movie_camera:', 'Taking pictures :camera:', - 'Suggesting things for the server :dancers:', + 'Suggesting things for the server :dancers:' ]; - if (args[0] === 'list') return msg.channel.send(ideas.join('\n')); + if (args[0] === 'list') { + return msg.channel.send(ideas.join('\n')); + } msg.channel.send(ideas[Math.floor(Math.random() * ideas.length)]); }; exports.conf = { aliases: ['cboredom'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'cureboredom', - description: 'Finds you something to do.', + description: 'Finds you something to do.' }; diff --git a/commands/Fun/findmyphone.js b/commands/Fun/findmyphone.js index 135d449..bb930ef 100644 --- a/commands/Fun/findmyphone.js +++ b/commands/Fun/findmyphone.js @@ -19,7 +19,7 @@ exports.run = (bot, msg) => { 'Stockton', 'Colorado Springs', 'Portland', - 'Cincinnati', + 'Cincinnati' ]; msg.channel.send(cities[Math.floor(Math.random() * cities.length)]); @@ -27,10 +27,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: ['findphone', 'findmyiphone', 'findmyandroid', 'findmyandroidphone'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'findmyphone', - description: 'Find your phone. Not just a random list of cities being randomly picked.', + description: 'Find your phone. Not just a random list of cities being randomly picked.' }; diff --git a/commands/Fun/gamble.js b/commands/Fun/gamble.js index 7921993..8e599dc 100644 --- a/commands/Fun/gamble.js +++ b/commands/Fun/gamble.js @@ -17,55 +17,73 @@ exports.run = async (bot, msg) => { 6, 7, 8, - 9, + 9 ]; const balance = await bot.plugins.economy.get(msg.author.id); - if (balance < 10) return await msg.reply('You don\'t have enough credits (10) to play the slots'); + if (balance < 10) { + return msg.reply('You don\'t have enough credits (10) to play the slots'); + } const number1 = slotNumbers[Math.floor(Math.random() * slotNumbers.length)]; const number2 = slotNumbers[Math.floor(Math.random() * slotNumbers.length)]; const number3 = slotNumbers[Math.floor(Math.random() * slotNumbers.length)]; - if (number2 == number1 + 1 && number3 == number2 + 1) { + if (number2 == number1 + 1 && number3 == number2 + 1) { await bot.plugins.economy.add(msg.author.id, 1000); const balance = await bot.plugins.economy.get(msg.author.id); - return await msg.channel.send('You won 1000 credits!\nCurrent Balance: ' + balance + ' \n> ' + emojify(number1, number2, number3)); - } - else if (number2 == number3 - 1 && number1 == number2 - 1) { + return msg.channel.send(`You won 1000 credits!\nCurrent Balance: ${ balance } \n> ${ emojify(number1, number2, number3)}`); + } else if (number2 == number3 - 1 && number1 == number2 - 1) { await bot.plugins.economy.add(msg.author.id, 1500); const balance = await bot.plugins.economy.get(msg.author.id); - return await msg.channel.send('You won 1500 credits!\nCurrent Balance: ' + balance + ' \n> ' + emojify(number1, number2, number3)); - } - else { + return msg.channel.send(`You won 1500 credits!\nCurrent Balance: ${ balance } \n> ${ emojify(number1, number2, number3)}`); + } else { await bot.plugins.economy.subtract(msg.author.id, 10); const balance = await bot.plugins.economy.get(msg.author.id); - return await msg.channel.send('Aww, you lost! Better luck next time.\nCurrent Balance: ' + balance + ' \n> ' + emojify(number1, number2, number3)); + return msg.channel.send(`Aww, you lost! Better luck next time.\nCurrent Balance: ${ balance } \n> ${ emojify(number1, number2, number3)}`); } }; function emojify(number1, number2, number3) { - return emote(number1) + ' ' + emote(number2) + ' ' + emote(number3); + return `${emote(number1) } ${ emote(number2) } ${ emote(number3)}`; } function emote(number) { - if (number == 1) return ':one:'; - if (number == 2) return ':two:'; - if (number == 3) return ':three:'; - if (number == 4) return ':four:'; - if (number == 5) return ':five:'; - if (number == 6) return ':six:'; - if (number == 7) return ':seven:'; - if (number == 8) return ':eight:'; - if (number == 9) return ':nine:'; + if (number == 1) { + return ':one:'; + } + if (number == 2) { + return ':two:'; + } + if (number == 3) { + return ':three:'; + } + if (number == 4) { + return ':four:'; + } + if (number == 5) { + return ':five:'; + } + if (number == 6) { + return ':six:'; + } + if (number == 7) { + return ':seven:'; + } + if (number == 8) { + return ':eight:'; + } + if (number == 9) { + return ':nine:'; + } } exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'gamble', - description: 'Develop a gambling addiction by playing Slots!', + description: 'Develop a gambling addiction by playing Slots!' }; diff --git a/commands/Fun/jobs.js b/commands/Fun/jobs.js index f71ba28..d71ac31 100644 --- a/commands/Fun/jobs.js +++ b/commands/Fun/jobs.js @@ -9,31 +9,32 @@ const cooldown = new Set(); exports.run = (bot, msg) => { - if (cooldown.has(msg.author.id)) return msg.reply('You have worked too recently'); + if (cooldown.has(msg.author.id)) { + return msg.reply('You have worked too recently'); + } const jobs = [ - "started a BitCoin farm", - "pissed for an elderly woman", - "became a doctor and illegally sold organs", - "extracted eggs from elderly women", - "became a bus driver", - "started working for Universe Dev Group", - "programmed a Discord bot", - "made a crowdfunding campaign", - "became a news anchor", - "flooded Amsterdam", - "became YouTube famous.", - ] + 'started a BitCoin farm', + 'pissed for an elderly woman', + 'became a doctor and illegally sold organs', + 'extracted eggs from elderly women', + 'became a bus driver', + 'started working for Universe Dev Group', + 'programmed a Discord bot', + 'made a crowdfunding campaign', + 'became a news anchor', + 'flooded Amsterdam', + 'became YouTube famous.' + ]; if (bot.dbl.hasVoted(msg.author.id)) { - var creditsEarned = Math.floor(Math.random() * 650); + const creditsEarned = Math.floor(Math.random() * 650); bot.plugins.economy.add(msg.author.id, creditsEarned); - msg.channel.send('You worked and ' + jobs[Math.floor(Math.random() * jobs.length)] + '\n\nYou earned ' + creditsEarned.toString() + ' credits.'); - } - else { - var creditsEarned = Math.floor(Math.random() * 250); + msg.channel.send(`You worked and ${ jobs[Math.floor(Math.random() * jobs.length)] }\n\nYou earned ${ creditsEarned.toString() } credits.`); + } else { + const creditsEarned = Math.floor(Math.random() * 250); bot.plugins.economy.add(msg.author.id, creditsEarned); - msg.channel.send('You worked and ' + jobs[Math.floor(Math.random() * jobs.length)] + '\n\nYou earned ' + creditsEarned.toString() + ' credits.'); + msg.channel.send(`You worked and ${ jobs[Math.floor(Math.random() * jobs.length)] }\n\nYou earned ${ creditsEarned.toString() } credits.`); } cooldown.add(msg.author.id); setTimeout(() => { @@ -43,10 +44,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'jobs', - description: 'Work to add credits to your account.', + description: 'Work to add credits to your account.' }; diff --git a/commands/Fun/og151.js b/commands/Fun/og151.js index d2b3ccf..d14d7dd 100644 --- a/commands/Fun/og151.js +++ b/commands/Fun/og151.js @@ -159,7 +159,7 @@ exports.run = (bot, msg) => { 'Weezing', 'Wigglytuff', 'Zapdos', - 'Zubat', + 'Zubat' ]; msg.channel.send(pokemon[Math.floor(Math.random() * pokemon.length)]); @@ -167,10 +167,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'og151', - description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.', + description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.' }; diff --git a/commands/Fun/ship.js b/commands/Fun/ship.js index ba31db5..499ab06 100644 --- a/commands/Fun/ship.js +++ b/commands/Fun/ship.js @@ -8,15 +8,15 @@ * *************************************/ exports.run = (bot, msg) => { - msg.channel.send(msg.author.username + ' x ' + msg.guild.members.random().displayName + ' :cruise_ship:'); + msg.channel.send(`${msg.author.username} x ${msg.guild.members.random().displayName} :cruise_ship:`); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'ship', - description: 'Test the luck of your love life! Ships you with another user.', + description: 'Test the luck of your love life! Ships you with another user.' }; diff --git a/commands/Fun/story.js b/commands/Fun/story.js index c35e3e7..b8a6da6 100644 --- a/commands/Fun/story.js +++ b/commands/Fun/story.js @@ -8,40 +8,38 @@ * *************************************/ exports.run = async (bot, msg) => { - msg.guild.fetchMembers().then(guild => - { - const membersList = guild.members.array(); - const selectedUser1 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser2 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser3 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser4 = membersList[Math.floor(Math.random() * membersList.length)].user; + const guild = await msg.guild.fetchMembers(); + const membersList = guild.members.array(); + const selectedUser1 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser2 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser3 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser4 = membersList[Math.floor(Math.random() * membersList.length)].user; - const stories = + const stories = [ `${selectedUser1.username} bought ${selectedUser2.username} his favorite video game. This game is called "Pokemon". Then, they became best friends.`, `${selectedUser1.username} wants to become a Pokemon trainer, but he needs to get a Pokemon first!`, `One day, ${selectedUser1.username} decided to go to a shop. He took his motorbike. Once he arrived at the shop, he went inside. He headed right, towards the chips. He grabbed a packet, and headed to check-out. He bumped into ${selectedUser2.username} at the counter, and decided to say hi. They had a little chat, and then decided to gossip about ${selectedUser3.username}. Then, as they were saying some horrible things about ${selectedUser3.username}, they unexpectedly showed up! Then, ${selectedUser1.username} and ${selectedUser2.username} got into a fight against ${selectedUser3.username}.\n\nKids, this is why you don't start drama.\nNow ${selectedUser1.username}, ${selectedUser2.username}, and ${selectedUser3.username} are no longer friends.`, `At a point in time, ${selectedUser1.username} was battling ${selectedUser2.username} for a gym. ${selectedUser1.username} chose Sylveon to battle, when ${selectedUser2.username} chose their trusty Eevee. First, Eevee used Tackle, when Sylveon went in for Draining Kiss. Then, ${selectedUser2.username} shouted an expletive. Once they shouted it, ${selectedUser3.username} came inside the room. ${selectedUser3.username} does not like expletives, so they got into an arguement about them. Soon enough, vicr123 got in here too and started using "-" in place of expletives during the argument. Eventually, ${selectedUser2.username} and ${selectedUser3.username} were shouting expletives at each-other, vicr123 was audibly shouting "Dash! Dash you!", while ${selectedUser1.username} was smashing his head on his desk.`, `It was the day of the release of Pokemon Ultra Sun and Ultra Moon. ${selectedUser1.username} and ${selectedUser2.username} decided to go to GameStop to wait in line to grab their pre-order copies. Then, ${selectedUser3.username} came along, and got mad once they realised ${selectedUser1.username} and ${selectedUser2.username} had pre-orders, when ${selectedUser3.username} did not. Eventually, ${selectedUser3.username} started physically assaulting ${selectedUser1.username} when they came outside with their pre-order copy. Then, known police officer ${selectedUser4.username} came up to ${selectedUser3.username} and ${selectedUser1.username} and charged them both for Indecent Exposure, and Assault of the Second Degree.\n\nMoral of the story: Do not get into an assualt over a video-game, like ${selectedUser3.username} and ${selectedUser1.username} did.`, - `${selectedUser1.username} played this new game called Pokemon (this is back in 1996) and his friend ${selectedUser2.username} also bought that game. And then Victor Tran decided to say "Ooh! What's that game". Then ${selectedUser2.username} said "It's Pokemon!". Then Victor said "- you...", after that ${selectedUser1.username} facepalmed.`, + `${selectedUser1.username} played this new game called Pokemon (this is back in 1996) and his friend ${selectedUser2.username} also bought that game. And then Victor Tran decided to say "Ooh! What's that game". Then ${selectedUser2.username} said "It's Pokemon!". Then Victor said "- you...", after that ${selectedUser1.username} facepalmed.` ]; - const storySelected = [Math.floor(Math.random() * stories.length)]; - const { RichEmbed } = require('discord.js'); - const embed = new RichEmbed() - .setColor(0x00ae86) - .setTitle('PokeBot Storytime') - .setDescription(stories[storySelected]) - .setFooter('PokeBot v1.0'); - msg.channel.send({ embed }); - }); + const storySelected = [Math.floor(Math.random() * stories.length)]; + const {RichEmbed} = require('discord.js'); + const embed = new RichEmbed() + .setColor(0x00ae86) + .setTitle('PokeBot Storytime') + .setDescription(stories[storySelected]) + .setFooter('PokeBot v1.0'); + msg.channel.send({embed}); }; exports.conf = { aliases: ['storytime'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'story', - description: 'Tells you a story.', + description: 'Tells you a story.' }; |
