From 1c9ac56831fa37c1a8ce275eb58019f9d23f3d88 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 16 Sep 2017 01:44:44 +0000 Subject: [PATCH] Change arg assignment --- commands/avatar-edit/3000-years.js | 4 ++-- commands/avatar-edit/approved.js | 4 ++-- commands/avatar-edit/avatar-fusion.js | 5 ++--- commands/avatar-edit/beautiful.js | 4 ++-- commands/avatar-edit/bob-ross.js | 4 ++-- commands/avatar-edit/card.js | 4 ++-- commands/avatar-edit/challenger.js | 4 ++-- commands/avatar-edit/dexter.js | 4 ++-- commands/avatar-edit/greyscale.js | 4 ++-- commands/avatar-edit/invert.js | 4 ++-- commands/avatar-edit/rainbow.js | 4 ++-- commands/avatar-edit/rejected.js | 4 ++-- commands/avatar-edit/rip.js | 4 ++-- commands/avatar-edit/simba.js | 4 ++-- commands/avatar-edit/steam-card.js | 4 ++-- commands/avatar-edit/steam-now-playing.js | 5 ++--- commands/avatar-edit/thug-life.js | 4 ++-- commands/avatar-edit/triggered.js | 4 ++-- commands/avatar-edit/wanted.js | 4 ++-- commands/avatar-edit/yu-gi-oh-token.js | 4 ++-- commands/games/battle.js | 4 ++-- commands/games/emoji-emoji-revolution.js | 3 +-- commands/games/gunfight.js | 3 +-- commands/games/math-game.js | 3 +-- commands/games/quiz.js | 3 +-- commands/games/rock-paper-scissors.js | 3 +-- commands/games/tic-tac-toe.js | 4 ++-- commands/games/typing-game.js | 3 +-- commands/guild-info/channel-info.js | 4 ++-- commands/guild-info/role-info.js | 3 +-- commands/image-edit/achievement.js | 3 +-- commands/image-edit/color.js | 3 +-- commands/image-edit/meme.js | 3 +-- commands/image-edit/pokemon-fusion.js | 3 +-- commands/moderation/ban.js | 3 +-- commands/moderation/hackban.js | 3 +-- commands/moderation/kick.js | 3 +-- commands/moderation/lockdown.js | 3 +-- commands/moderation/prune.js | 3 +-- commands/moderation/softban.js | 3 +-- commands/moderation/unban.js | 3 +-- commands/num-edit/currency.js | 3 +-- commands/num-edit/temperature.js | 3 +-- commands/random-res/8-ball.js | 3 +-- commands/random-res/choose.js | 3 +-- commands/random-res/chuck-norris.js | 3 +-- commands/random-res/compliment.js | 4 ++-- commands/random-res/history.js | 3 +-- commands/random-res/magic-conch.js | 3 +-- commands/random-res/name.js | 3 +-- commands/random-res/number-fact.js | 3 +-- commands/random-res/rate-waifu.js | 3 +-- commands/random-res/roast.js | 4 ++-- commands/random-res/roll.js | 3 +-- commands/random-res/ship.js | 3 +-- commands/random/horoscope.js | 3 +-- commands/random/lmgtfy.js | 3 +-- commands/random/soundboard.js | 4 ++-- commands/random/spoopy-link.js | 3 +-- commands/random/strawpoll.js | 3 +-- commands/random/tag.js | 3 +-- commands/random/xkcd.js | 3 +-- commands/roleplay/break-up.js | 3 +-- commands/roleplay/cuddle.js | 3 +-- commands/roleplay/eat.js | 3 +-- commands/roleplay/evolve.js | 3 +-- commands/roleplay/falcon-punch.js | 3 +-- commands/roleplay/fist-bump.js | 3 +-- commands/roleplay/high-five.js | 3 +-- commands/roleplay/hit-with-shovel.js | 3 +-- commands/roleplay/hug.js | 3 +-- commands/roleplay/inhale.js | 3 +-- commands/roleplay/kill.js | 3 +-- commands/roleplay/kiss.js | 3 +-- commands/roleplay/marry.js | 3 +-- commands/roleplay/pat.js | 3 +-- commands/roleplay/poke.js | 3 +-- commands/roleplay/punch.js | 3 +-- commands/roleplay/slap.js | 3 +-- commands/search/anime.js | 3 +-- commands/search/bot-info.js | 3 +-- commands/search/bulbapedia.js | 3 +-- commands/search/define.js | 3 +-- commands/search/discrim.js | 4 ++-- commands/search/giphy.js | 3 +-- commands/search/github.js | 3 +-- commands/search/itunes.js | 3 +-- commands/search/manga.js | 3 +-- commands/search/map.js | 3 +-- commands/search/mdn.js | 3 +-- commands/search/movie.js | 3 +-- commands/search/nasa.js | 3 +-- commands/search/neopet.js | 3 +-- commands/search/npm.js | 3 +-- commands/search/osu.js | 3 +-- commands/search/pokedex.js | 3 +-- commands/search/recipe.js | 3 +-- commands/search/reddit.js | 3 +-- commands/search/steam.js | 3 +-- commands/search/stocks.js | 3 +-- commands/search/tv-show.js | 3 +-- commands/search/urban.js | 3 +-- commands/search/vocaloid.js | 3 +-- commands/search/wattpad.js | 3 +-- commands/search/weather.js | 3 +-- commands/search/wikia.js | 3 +-- commands/search/wikipedia.js | 3 +-- commands/search/youtube.js | 3 +-- commands/search/yu-gi-oh.js | 3 +-- commands/text-edit/b.js | 3 +-- commands/text-edit/binary.js | 3 +-- commands/text-edit/clap.js | 7 +++---- commands/text-edit/cow-say.js | 3 +-- commands/text-edit/embed.js | 3 +-- commands/text-edit/emojify.js | 3 +-- commands/text-edit/mocking.js | 3 +-- commands/text-edit/morse.js | 3 +-- commands/text-edit/organization-xiii-name.js | 3 +-- commands/text-edit/pirate.js | 3 +-- commands/text-edit/repeat.js | 3 +-- commands/text-edit/reverse.js | 3 +-- commands/text-edit/say.js | 3 +-- commands/text-edit/ship-name.js | 3 +-- commands/text-edit/shuffle.js | 3 +-- commands/text-edit/temmie.js | 3 +-- commands/text-edit/translate.js | 3 +-- commands/text-edit/upside-down.js | 3 +-- commands/text-edit/webhook.js | 3 +-- commands/text-edit/yoda.js | 3 +-- commands/text-edit/zalgo.js | 3 +-- commands/user-info/avatar.js | 4 ++-- commands/user-info/user-info.js | 4 ++-- commands/util/help.js | 3 +-- commands/util/shard-info.js | 3 +-- package.json | 2 +- 135 files changed, 166 insertions(+), 273 deletions(-) diff --git a/commands/avatar-edit/3000-years.js b/commands/avatar-edit/3000-years.js index 8078a731..f8f71c34 100644 --- a/commands/avatar-edit/3000-years.js +++ b/commands/avatar-edit/3000-years.js @@ -27,8 +27,8 @@ module.exports = class YearsCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/approved.js b/commands/avatar-edit/approved.js index a1fb056c..0e0f8db3 100644 --- a/commands/avatar-edit/approved.js +++ b/commands/avatar-edit/approved.js @@ -27,8 +27,8 @@ module.exports = class ApprovedCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/avatar-fusion.js b/commands/avatar-edit/avatar-fusion.js index 434b3f47..b3046c10 100644 --- a/commands/avatar-edit/avatar-fusion.js +++ b/commands/avatar-edit/avatar-fusion.js @@ -31,9 +31,8 @@ module.exports = class AvatarFusionCommand extends Command { }); } - async run(msg, args) { - const { overlay } = args; - const base = args.base || msg.author; + async run(msg, { overlay, base }) { + if (!base) base = msg.author; const baseAvatarURL = base.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/beautiful.js b/commands/avatar-edit/beautiful.js index d7f2fa5f..663c30ac 100644 --- a/commands/avatar-edit/beautiful.js +++ b/commands/avatar-edit/beautiful.js @@ -27,8 +27,8 @@ module.exports = class BeautifulCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/bob-ross.js b/commands/avatar-edit/bob-ross.js index 8e1f0e43..8b7ed095 100644 --- a/commands/avatar-edit/bob-ross.js +++ b/commands/avatar-edit/bob-ross.js @@ -27,8 +27,8 @@ module.exports = class BobRossCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/card.js b/commands/avatar-edit/card.js index 22da5231..4164e2dc 100644 --- a/commands/avatar-edit/card.js +++ b/commands/avatar-edit/card.js @@ -32,8 +32,8 @@ module.exports = class CardCommand extends Command { }); } - async run(msg, args) { - const member = args.member || msg.member; + async run(msg, { member }) { + if (!member) member = msg.member; const avatarURL = member.user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/challenger.js b/commands/avatar-edit/challenger.js index 864280fc..bf5c6761 100644 --- a/commands/avatar-edit/challenger.js +++ b/commands/avatar-edit/challenger.js @@ -26,8 +26,8 @@ module.exports = class ChallengerCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/dexter.js b/commands/avatar-edit/dexter.js index f3bc52e7..84e6b462 100644 --- a/commands/avatar-edit/dexter.js +++ b/commands/avatar-edit/dexter.js @@ -26,8 +26,8 @@ module.exports = class DexterCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/greyscale.js b/commands/avatar-edit/greyscale.js index e5b93df1..d85aa30c 100644 --- a/commands/avatar-edit/greyscale.js +++ b/commands/avatar-edit/greyscale.js @@ -26,8 +26,8 @@ module.exports = class GreyscaleCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/invert.js b/commands/avatar-edit/invert.js index 3066df6e..9d5be671 100644 --- a/commands/avatar-edit/invert.js +++ b/commands/avatar-edit/invert.js @@ -25,8 +25,8 @@ module.exports = class InvertCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/rainbow.js b/commands/avatar-edit/rainbow.js index 85065b8a..0fe9eac9 100644 --- a/commands/avatar-edit/rainbow.js +++ b/commands/avatar-edit/rainbow.js @@ -27,8 +27,8 @@ module.exports = class RainbowCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/rejected.js b/commands/avatar-edit/rejected.js index 356852a4..c508f73e 100644 --- a/commands/avatar-edit/rejected.js +++ b/commands/avatar-edit/rejected.js @@ -27,8 +27,8 @@ module.exports = class RejctedCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/rip.js b/commands/avatar-edit/rip.js index 13c3f757..ea287983 100644 --- a/commands/avatar-edit/rip.js +++ b/commands/avatar-edit/rip.js @@ -27,8 +27,8 @@ module.exports = class RIPCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/simba.js b/commands/avatar-edit/simba.js index 2af6f7c6..50e22383 100644 --- a/commands/avatar-edit/simba.js +++ b/commands/avatar-edit/simba.js @@ -26,8 +26,8 @@ module.exports = class SimbaCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/steam-card.js b/commands/avatar-edit/steam-card.js index 548d8ac4..ac065e33 100644 --- a/commands/avatar-edit/steam-card.js +++ b/commands/avatar-edit/steam-card.js @@ -30,8 +30,8 @@ module.exports = class SteamCardCommand extends Command { }); } - async run(msg, args) { - const member = args.member || msg.member; + async run(msg, { member }) { + if (!member) member = msg.member; const avatarURL = member.user.displayAvatarURL({ format: 'png', size: 512 diff --git a/commands/avatar-edit/steam-now-playing.js b/commands/avatar-edit/steam-now-playing.js index 9bb32784..463cc61d 100644 --- a/commands/avatar-edit/steam-now-playing.js +++ b/commands/avatar-edit/steam-now-playing.js @@ -36,9 +36,8 @@ module.exports = class SteamNowPlayingCommand extends Command { }); } - async run(msg, args) { - let { game } = args; - const member = args.member || msg.member; + async run(msg, { game, member }) { + if (!member) member = msg.member; const avatarURL = member.user.displayAvatarURL({ format: 'png', size: 128 diff --git a/commands/avatar-edit/thug-life.js b/commands/avatar-edit/thug-life.js index 0dfa04ae..b7ad95c3 100644 --- a/commands/avatar-edit/thug-life.js +++ b/commands/avatar-edit/thug-life.js @@ -26,8 +26,8 @@ module.exports = class ThugLifeCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 diff --git a/commands/avatar-edit/triggered.js b/commands/avatar-edit/triggered.js index f87529cd..b505c244 100644 --- a/commands/avatar-edit/triggered.js +++ b/commands/avatar-edit/triggered.js @@ -26,8 +26,8 @@ module.exports = class TriggeredCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 diff --git a/commands/avatar-edit/wanted.js b/commands/avatar-edit/wanted.js index 9e1dc870..5b803b3b 100644 --- a/commands/avatar-edit/wanted.js +++ b/commands/avatar-edit/wanted.js @@ -26,8 +26,8 @@ module.exports = class WantedCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 diff --git a/commands/avatar-edit/yu-gi-oh-token.js b/commands/avatar-edit/yu-gi-oh-token.js index 9e340441..f04f9a3a 100644 --- a/commands/avatar-edit/yu-gi-oh-token.js +++ b/commands/avatar-edit/yu-gi-oh-token.js @@ -26,8 +26,8 @@ module.exports = class YuGiOhTokenCommand extends Command { }); } - async run(msg, args) { - const user = args.user || msg.author; + async run(msg, { user }) { + if (!user) user = msg.author; const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 diff --git a/commands/games/battle.js b/commands/games/battle.js index 5d04dd9b..5b4569da 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -22,8 +22,8 @@ module.exports = class BattleCommand extends Command { this.fighting = new Set(); } - async run(msg, args) { // eslint-disable-line complexity - const opponent = args.opponent || this.client.user; + async run(msg, { opponent }) { // eslint-disable-line complexity + if (!opponent) opponent = this.client.user; if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.'); if (this.fighting.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.'); this.fighting.add(msg.channel.id); diff --git a/commands/games/emoji-emoji-revolution.js b/commands/games/emoji-emoji-revolution.js index 281409b3..6a043955 100644 --- a/commands/games/emoji-emoji-revolution.js +++ b/commands/games/emoji-emoji-revolution.js @@ -23,8 +23,7 @@ module.exports = class EmojiEmojiRevolutionCommand extends Command { this.playing = new Set(); } - async run(msg, args) { - const { opponent } = args; + async run(msg, { opponent }) { if (opponent.bot) return msg.say('Bots may not be played against.'); if (opponent.id === msg.author.id) return msg.say('You may not play against yourself.'); if (this.playing.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.'); diff --git a/commands/games/gunfight.js b/commands/games/gunfight.js index 7d7f4d76..0b683bf2 100644 --- a/commands/games/gunfight.js +++ b/commands/games/gunfight.js @@ -23,8 +23,7 @@ module.exports = class GunfightCommand extends Command { this.fighting = new Set(); } - async run(msg, args) { - const { opponent } = args; + async run(msg, { opponent }) { if (opponent.bot) return msg.say('Bots may not be fought.'); if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.'); if (this.fighting.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.'); diff --git a/commands/games/math-game.js b/commands/games/math-game.js index 5d64c1b8..17f000d5 100644 --- a/commands/games/math-game.js +++ b/commands/games/math-game.js @@ -50,8 +50,7 @@ module.exports = class MathGameCommand extends Command { }); } - async run(msg, args) { - const { operation, difficulty } = args; + async run(msg, { operation, difficulty }) { const value1 = Math.floor(Math.random() * maxValues[difficulty]) + 1; const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1; let answer; diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 89f2bb9f..37a13ecb 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -40,8 +40,7 @@ module.exports = class QuizCommand extends Command { }); } - async run(msg, args) { - const { type, difficulty } = args; + async run(msg, { type, difficulty }) { try { const { body } = await snekfetch .get('https://opentdb.com/api.php') diff --git a/commands/games/rock-paper-scissors.js b/commands/games/rock-paper-scissors.js index 1f07d7cf..673627ff 100644 --- a/commands/games/rock-paper-scissors.js +++ b/commands/games/rock-paper-scissors.js @@ -20,8 +20,7 @@ module.exports = class RockPaperScissorsCommand extends Command { }); } - run(msg, args) { - const { choice } = args; + run(msg, { choice }) { const response = choices[Math.floor(Math.random() * choices.length)]; if (choice === 'rock') { if (response === 'rock') return msg.say('Rock! Aw... A tie...'); diff --git a/commands/games/tic-tac-toe.js b/commands/games/tic-tac-toe.js index ec2e9d77..e5054ae2 100644 --- a/commands/games/tic-tac-toe.js +++ b/commands/games/tic-tac-toe.js @@ -21,8 +21,8 @@ module.exports = class TicTacToeCommand extends Command { this.playing = new Set(); } - async run(msg, args) { // eslint-disable-line complexity - const opponent = args.opponent || this.client.user; + async run(msg, { opponent }) { // eslint-disable-line complexity + if (!opponent) opponent = this.client.user; if (opponent.id === msg.author.id) return msg.say('You may not play against yourself.'); if (this.playing.has(msg.channel.id)) return msg.say('Only one game may be occurring per channel.'); this.playing.add(msg.channel.id); diff --git a/commands/games/typing-game.js b/commands/games/typing-game.js index 0e2ef9d1..6bd6e06a 100644 --- a/commands/games/typing-game.js +++ b/commands/games/typing-game.js @@ -34,8 +34,7 @@ module.exports = class TypingGameCommand extends Command { }); } - async run(msg, args) { - const { difficulty } = args; + async run(msg, { difficulty }) { const sentence = sentences[Math.floor(Math.random() * sentences.length)]; const time = times[difficulty]; await msg.say(stripIndents` diff --git a/commands/guild-info/channel-info.js b/commands/guild-info/channel-info.js index 0e88593e..050643bb 100644 --- a/commands/guild-info/channel-info.js +++ b/commands/guild-info/channel-info.js @@ -30,8 +30,8 @@ module.exports = class ChannelInfoCommand extends Command { }); } - run(msg, args) { - const channel = args.channel || msg.channel; + run(msg, { channel }) { + if (!channel) channel = msg.channel; const embed = new MessageEmbed() .setColor(0x00AE86) .addField('❯ Name', diff --git a/commands/guild-info/role-info.js b/commands/guild-info/role-info.js index 2162c2ab..6a8b6ee5 100644 --- a/commands/guild-info/role-info.js +++ b/commands/guild-info/role-info.js @@ -22,8 +22,7 @@ module.exports = class RoleInfoCommand extends Command { }); } - run(msg, args) { - const { role } = args; + run(msg, { role }) { const perms = Object.keys(util.permissions).filter(perm => role.serialize()[perm]); const embed = new MessageEmbed() .setColor(role.hexColor) diff --git a/commands/image-edit/achievement.js b/commands/image-edit/achievement.js index 802368ab..d7eacb7a 100644 --- a/commands/image-edit/achievement.js +++ b/commands/image-edit/achievement.js @@ -23,8 +23,7 @@ module.exports = class AchievementCommand extends Command { }); } - async run(msg, args) { - const { text } = args; + async run(msg, { text }) { try { const { body } = await snekfetch .get('https://www.minecraftskinstealer.com/achievement/a.php') diff --git a/commands/image-edit/color.js b/commands/image-edit/color.js index 4d2d628a..698f6d2e 100644 --- a/commands/image-edit/color.js +++ b/commands/image-edit/color.js @@ -20,8 +20,7 @@ module.exports = class ColorCommand extends Command { }); } - run(msg, args) { - const { color } = args; + run(msg, { color }) { const canvas = createCanvas(250, 250); const ctx = canvas.getContext('2d'); ctx.fillStyle = color; diff --git a/commands/image-edit/meme.js b/commands/image-edit/meme.js index 8e21ce8e..228081bb 100644 --- a/commands/image-edit/meme.js +++ b/commands/image-edit/meme.js @@ -47,8 +47,7 @@ module.exports = class MemeCommand extends Command { }); } - async run(msg, args) { - const { type, top, bottom } = args; + async run(msg, { type, top, bottom }) { try { const { body } = await snekfetch .get(`https://memegen.link/api/templates/${type}/${top}/${bottom}`, { followRedirects: true }); diff --git a/commands/image-edit/pokemon-fusion.js b/commands/image-edit/pokemon-fusion.js index 83e14710..c41d9f66 100644 --- a/commands/image-edit/pokemon-fusion.js +++ b/commands/image-edit/pokemon-fusion.js @@ -34,8 +34,7 @@ module.exports = class PokemonFusionCommand extends Command { }); } - run(msg, args) { - const { body, palette } = args; + run(msg, { body, palette }) { return msg.say(`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`); } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index cb415c55..d67e5f14 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -31,8 +31,7 @@ module.exports = class BanCommand extends Command { }); } - async run(msg, args) { - const { member, reason } = args; + async run(msg, { member, reason }) { if (member.id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...'); if (member.id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?'); if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); diff --git a/commands/moderation/hackban.js b/commands/moderation/hackban.js index 9c406849..68d7463f 100644 --- a/commands/moderation/hackban.js +++ b/commands/moderation/hackban.js @@ -30,8 +30,7 @@ module.exports = class HackbanCommand extends Command { }); } - async run(msg, args) { - const { id, reason } = args; + async run(msg, { id, reason }) { if (id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...'); if (id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?'); let user; diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index c5b9ee23..b8c4973f 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -31,8 +31,7 @@ module.exports = class KickCommand extends Command { }); } - async run(msg, args) { - const { member, reason } = args; + async run(msg, { member, reason }) { if (member.id === msg.author.id) return msg.say('I don\'t think you want to kick yourself...'); if (member.id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?'); if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?'); diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index aa9fba6e..48537b71 100644 --- a/commands/moderation/lockdown.js +++ b/commands/moderation/lockdown.js @@ -27,8 +27,7 @@ module.exports = class LockdownCommand extends Command { }); } - async run(msg, args) { // eslint-disable-line consistent-return - const { action } = args; + async run(msg, { action }) { // eslint-disable-line consistent-return if (action === 'start') { await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: false }); return msg.say(stripIndents` diff --git a/commands/moderation/prune.js b/commands/moderation/prune.js index 17cdd5f5..040efaf9 100644 --- a/commands/moderation/prune.js +++ b/commands/moderation/prune.js @@ -29,8 +29,7 @@ module.exports = class PruneCommand extends Command { }); } - async run(msg, args) { - const { count } = args; + async run(msg, { count }) { try { const messages = await msg.channel.messages.fetch({ limit: count + 1 }); await msg.channel.bulkDelete(messages, true); diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 6ede742e..44bc75c9 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -31,8 +31,7 @@ module.exports = class SoftbanCommand extends Command { }); } - async run(msg, args) { - const { member, reason } = args; + async run(msg, { member, reason }) { if (member.id === msg.author.id) return msg.say('I don\'t think you want to softban yourself...'); if (member.id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?'); if (!member.bannable) return msg.say('This member is not softbannable. Perhaps they have a higher role than me?'); diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index 8a5db0d2..68727298 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -30,8 +30,7 @@ module.exports = class UnbanCommand extends Command { }); } - async run(msg, args) { - const { id, reason } = args; + async run(msg, { id, reason }) { const bans = await msg.guild.fetchBans(); if (!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.'); const member = bans.get(id).user; diff --git a/commands/num-edit/currency.js b/commands/num-edit/currency.js index 91515079..c166b7c4 100644 --- a/commands/num-edit/currency.js +++ b/commands/num-edit/currency.js @@ -41,8 +41,7 @@ module.exports = class CurrencyCommand extends Command { }); } - async run(msg, args) { - const { base, target, amount } = args; + async run(msg, { base, target, amount }) { if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`); try { const { body } = await snekfetch diff --git a/commands/num-edit/temperature.js b/commands/num-edit/temperature.js index 295a2aa9..962a678d 100644 --- a/commands/num-edit/temperature.js +++ b/commands/num-edit/temperature.js @@ -39,8 +39,7 @@ module.exports = class TemperatureCommand extends Command { }); } - run(msg, args) { // eslint-disable-line consistent-return - const { base, target, amount } = args; + run(msg, { base, target, amount }) { // eslint-disable-line consistent-return if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`); if (base === 'celsius') { if (target === 'fahrenheit') return msg.say(`${amount}°C is ${(amount * 1.8) + 32}°F.`); diff --git a/commands/random-res/8-ball.js b/commands/random-res/8-ball.js index 751acbf0..115ad580 100644 --- a/commands/random-res/8-ball.js +++ b/commands/random-res/8-ball.js @@ -19,8 +19,7 @@ module.exports = class MagicBallCommand extends Command { }); } - run(msg, args) { - const { question } = args; + run(msg, { question }) { return msg.say(stripIndents` Question: ${question} 🎱 ${answers[Math.floor(Math.random() * answers.length)]} 🎱 diff --git a/commands/random-res/choose.js b/commands/random-res/choose.js index 4cc69638..5c1690d5 100644 --- a/commands/random-res/choose.js +++ b/commands/random-res/choose.js @@ -18,8 +18,7 @@ module.exports = class ChooseCommand extends Command { }); } - run(msg, args) { - const { choices } = args; + run(msg, { choices }) { return msg.say(`I choose ${choices[Math.floor(Math.random() * choices.length)]}!`); } }; diff --git a/commands/random-res/chuck-norris.js b/commands/random-res/chuck-norris.js index 99cdfef8..52829d09 100644 --- a/commands/random-res/chuck-norris.js +++ b/commands/random-res/chuck-norris.js @@ -20,8 +20,7 @@ module.exports = class ChuckNorrisCommand extends Command { }); } - async run(msg, args) { - const { name } = args; + async run(msg, { name }) { try { const { body } = await snekfetch .get('http://api.icndb.com/jokes/random') diff --git a/commands/random-res/compliment.js b/commands/random-res/compliment.js index de2013f9..c0f44a35 100644 --- a/commands/random-res/compliment.js +++ b/commands/random-res/compliment.js @@ -19,8 +19,8 @@ module.exports = class ComplimentCommand extends Command { }); } - run(msg, args) { - const user = args.user || msg.author; + run(msg, { user }) { + if (!user) user = msg.author; return msg.say(`${user.username}, ${compliments[Math.floor(Math.random() * compliments.length)]}`); } }; diff --git a/commands/random-res/history.js b/commands/random-res/history.js index a4cece3b..cf67828c 100644 --- a/commands/random-res/history.js +++ b/commands/random-res/history.js @@ -22,8 +22,7 @@ module.exports = class HistoryCommand extends Command { }); } - async run(msg, args) { - const { date } = args; + async run(msg, { date }) { try { const { text } = await snekfetch .get(`http://history.muffinlabs.com/date${date ? `/${date}` : ''}`); diff --git a/commands/random-res/magic-conch.js b/commands/random-res/magic-conch.js index 4b2df1ac..5d21b883 100644 --- a/commands/random-res/magic-conch.js +++ b/commands/random-res/magic-conch.js @@ -19,8 +19,7 @@ module.exports = class MagicConchCommand extends Command { }); } - run(msg, args) { - const { question } = args; + run(msg, { question }) { return msg.say(stripIndents` Question: ${question} 🐚 ${answers[Math.floor(Math.random() * answers.length)]} 🐚 diff --git a/commands/random-res/name.js b/commands/random-res/name.js index c16083e5..eb0126c2 100644 --- a/commands/random-res/name.js +++ b/commands/random-res/name.js @@ -26,8 +26,7 @@ module.exports = class NameCommand extends Command { }); } - async run(msg, args) { - const { gender } = args; + async run(msg, { gender }) { try { const { body } = await snekfetch .get('http://namey.muffinlabs.com/name.json') diff --git a/commands/random-res/number-fact.js b/commands/random-res/number-fact.js index 31aa4c49..b00e9eb0 100644 --- a/commands/random-res/number-fact.js +++ b/commands/random-res/number-fact.js @@ -18,8 +18,7 @@ module.exports = class NumberFactCommand extends Command { }); } - async run(msg, args) { - const { number } = args; + async run(msg, { number }) { try { const { text } = await snekfetch .get(`http://numbersapi.com/${number}`); diff --git a/commands/random-res/rate-waifu.js b/commands/random-res/rate-waifu.js index ef3a7467..8c61168b 100644 --- a/commands/random-res/rate-waifu.js +++ b/commands/random-res/rate-waifu.js @@ -18,8 +18,7 @@ module.exports = class RateWaifuCommand extends Command { }); } - run(msg, args) { - const { waifu } = args; + run(msg, { waifu }) { return msg.say(`I'd give ${waifu} a ${Math.floor(Math.random() * 10) + 1}/10!`); } }; diff --git a/commands/random-res/roast.js b/commands/random-res/roast.js index 9efc2505..658c8879 100644 --- a/commands/random-res/roast.js +++ b/commands/random-res/roast.js @@ -19,8 +19,8 @@ module.exports = class RoastCommand extends Command { }); } - run(msg, args) { - const user = args.user || msg.author; + run(msg, { user }) { + if (!user) user = msg.author; return msg.say(`${user.username}, ${roasts[Math.floor(Math.random() * roasts.length)]}`); } }; diff --git a/commands/random-res/roll.js b/commands/random-res/roll.js index 09b6dbbf..421ef7f9 100644 --- a/commands/random-res/roll.js +++ b/commands/random-res/roll.js @@ -20,8 +20,7 @@ module.exports = class RollCommand extends Command { }); } - run(msg, args) { - const { value } = args; + run(msg, { value }) { return msg.say(`You rolled a ${Math.floor(Math.random() * value) + 1}.`); } }; diff --git a/commands/random-res/ship.js b/commands/random-res/ship.js index d9ef64e6..5e5b2834 100644 --- a/commands/random-res/ship.js +++ b/commands/random-res/ship.js @@ -19,8 +19,7 @@ module.exports = class ShipCommand extends Command { }); } - run(msg, args) { - const { things } = args; + run(msg, { things }) { return msg.say(`I'd give ${list(things)} a ${Math.floor(Math.random() * 100) + 1}%!`); } }; diff --git a/commands/random/horoscope.js b/commands/random/horoscope.js index 1e75760e..d2310699 100644 --- a/commands/random/horoscope.js +++ b/commands/random/horoscope.js @@ -41,8 +41,7 @@ module.exports = class HoroscopeCommand extends Command { }); } - async run(msg, args) { - const { sign } = args; + async run(msg, { sign }) { try { const { text } = await snekfetch .get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today/`); diff --git a/commands/random/lmgtfy.js b/commands/random/lmgtfy.js index 316740ba..e286fcb6 100644 --- a/commands/random/lmgtfy.js +++ b/commands/random/lmgtfy.js @@ -18,8 +18,7 @@ module.exports = class LMGTFYCommand extends Command { }); } - run(msg, args) { - const { query } = args; + run(msg, { query }) { return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`); } }; diff --git a/commands/random/soundboard.js b/commands/random/soundboard.js index fbe246ce..2c58a20e 100644 --- a/commands/random/soundboard.js +++ b/commands/random/soundboard.js @@ -33,8 +33,8 @@ module.exports = class SoundboardCommand extends Command { }); } - async run(msg, args) { - const sound = args.sound || sounds[Math.floor(Math.random() * sounds.length)]; + async run(msg, { sound }) { + if (!sound) sound = sounds[Math.floor(Math.random() * sounds.length)]; const channel = msg.member.voiceChannel; if (!channel) return msg.say('Please enter a voice channel first.'); if (!channel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) { diff --git a/commands/random/spoopy-link.js b/commands/random/spoopy-link.js index 525188e4..a0166ab6 100644 --- a/commands/random/spoopy-link.js +++ b/commands/random/spoopy-link.js @@ -20,8 +20,7 @@ module.exports = class SpoopyLinkCommand extends Command { }); } - async run(msg, args) { - const { site } = args; + async run(msg, { site }) { if (/discord(\.gg|app\.com%2Finvite|\.me)%2F/gi.test(site)) return msg.say('Discord invites are safe!'); try { const { body } = await snekfetch diff --git a/commands/random/strawpoll.js b/commands/random/strawpoll.js index 479a54cc..1ebbe5b7 100644 --- a/commands/random/strawpoll.js +++ b/commands/random/strawpoll.js @@ -34,8 +34,7 @@ module.exports = class StrawpollCommand extends Command { }); } - async run(msg, args) { - const { title, options } = args; + async run(msg, { title, options }) { if (options.length < 2) return msg.say('Please provide more than one choice.'); if (options.length > 31) return msg.say('Please provide thirty or less choices.'); try { diff --git a/commands/random/tag.js b/commands/random/tag.js index e26090a8..fcf39368 100644 --- a/commands/random/tag.js +++ b/commands/random/tag.js @@ -25,8 +25,7 @@ module.exports = class TagCommand extends Command { }); } - run(msg, args) { - const { tag } = args; + run(msg, { tag }) { return msg.say(tags[tag]); } }; diff --git a/commands/random/xkcd.js b/commands/random/xkcd.js index 1e20e08d..01150336 100644 --- a/commands/random/xkcd.js +++ b/commands/random/xkcd.js @@ -23,8 +23,7 @@ module.exports = class XKCDCommand extends Command { }); } - async run(msg, args) { - const { type } = args; + async run(msg, { type }) { try { const current = await snekfetch .get('https://xkcd.com/info.0.json'); diff --git a/commands/roleplay/break-up.js b/commands/roleplay/break-up.js index 0184192e..bd2c9087 100644 --- a/commands/roleplay/break-up.js +++ b/commands/roleplay/break-up.js @@ -26,8 +26,7 @@ module.exports = class BreakUpCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *breaks up with* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/cuddle.js b/commands/roleplay/cuddle.js index 3d337ac1..a09771de 100644 --- a/commands/roleplay/cuddle.js +++ b/commands/roleplay/cuddle.js @@ -25,8 +25,7 @@ module.exports = class CuddleCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *cuddles* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/eat.js b/commands/roleplay/eat.js index 3d81b3cb..cbb91dfb 100644 --- a/commands/roleplay/eat.js +++ b/commands/roleplay/eat.js @@ -25,8 +25,7 @@ module.exports = class EatCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *eats* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/evolve.js b/commands/roleplay/evolve.js index dfd27c1e..d472272d 100644 --- a/commands/roleplay/evolve.js +++ b/commands/roleplay/evolve.js @@ -25,8 +25,7 @@ module.exports = class EvolveCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${user.username}** *is evolving!* ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/falcon-punch.js b/commands/roleplay/falcon-punch.js index db45d663..fdcf195b 100644 --- a/commands/roleplay/falcon-punch.js +++ b/commands/roleplay/falcon-punch.js @@ -25,8 +25,7 @@ module.exports = class FalconPunchCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *falcon punches* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/fist-bump.js b/commands/roleplay/fist-bump.js index 8b243ec2..3cdcbcad 100644 --- a/commands/roleplay/fist-bump.js +++ b/commands/roleplay/fist-bump.js @@ -25,8 +25,7 @@ module.exports = class FistBumpCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *fist-bumps* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/high-five.js b/commands/roleplay/high-five.js index dd8e1b04..967d6d10 100644 --- a/commands/roleplay/high-five.js +++ b/commands/roleplay/high-five.js @@ -25,8 +25,7 @@ module.exports = class HighFivesCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *high-fives* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/hit-with-shovel.js b/commands/roleplay/hit-with-shovel.js index 77fcd8e2..95f66f0e 100644 --- a/commands/roleplay/hit-with-shovel.js +++ b/commands/roleplay/hit-with-shovel.js @@ -18,8 +18,7 @@ module.exports = class HitwithShovelCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *hits* **${user.username}** *with a shovel* https://i.imgur.com/4yvqw81.gif diff --git a/commands/roleplay/hug.js b/commands/roleplay/hug.js index 9089e143..575f9638 100644 --- a/commands/roleplay/hug.js +++ b/commands/roleplay/hug.js @@ -25,8 +25,7 @@ module.exports = class HugCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *hugs* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/inhale.js b/commands/roleplay/inhale.js index ca0937a0..59b5bcce 100644 --- a/commands/roleplay/inhale.js +++ b/commands/roleplay/inhale.js @@ -25,8 +25,7 @@ module.exports = class InhaleCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *inhales* **${user.username}** *but gained no ability...* ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/kill.js b/commands/roleplay/kill.js index a871e6f7..cfd831d2 100644 --- a/commands/roleplay/kill.js +++ b/commands/roleplay/kill.js @@ -18,8 +18,7 @@ module.exports = class KillCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *kills* **${user.username}** https://i.imgur.com/WxD4XMe.gif diff --git a/commands/roleplay/kiss.js b/commands/roleplay/kiss.js index 439db040..0d1e85cf 100644 --- a/commands/roleplay/kiss.js +++ b/commands/roleplay/kiss.js @@ -25,8 +25,7 @@ module.exports = class KissCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *kisses* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/marry.js b/commands/roleplay/marry.js index 99a1e263..182141ef 100644 --- a/commands/roleplay/marry.js +++ b/commands/roleplay/marry.js @@ -24,8 +24,7 @@ module.exports = class MarryCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *marries* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/pat.js b/commands/roleplay/pat.js index 7a175081..32ad1ad4 100644 --- a/commands/roleplay/pat.js +++ b/commands/roleplay/pat.js @@ -25,8 +25,7 @@ module.exports = class PatCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *pats* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/poke.js b/commands/roleplay/poke.js index c551a2f7..bdefa90a 100644 --- a/commands/roleplay/poke.js +++ b/commands/roleplay/poke.js @@ -25,8 +25,7 @@ module.exports = class PokeCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *pokes* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/punch.js b/commands/roleplay/punch.js index 901158d6..d2e968be 100644 --- a/commands/roleplay/punch.js +++ b/commands/roleplay/punch.js @@ -25,8 +25,7 @@ module.exports = class PunchCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *punches* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/roleplay/slap.js b/commands/roleplay/slap.js index 648f3f4d..4e47bc89 100644 --- a/commands/roleplay/slap.js +++ b/commands/roleplay/slap.js @@ -25,8 +25,7 @@ module.exports = class SlapCommand extends Command { }); } - run(msg, args) { - const { user } = args; + run(msg, { user }) { return msg.say(stripIndents` **${msg.author.username}** *slaps* **${user.username}** ${gifs[Math.floor(Math.random() * gifs.length)]} diff --git a/commands/search/anime.js b/commands/search/anime.js index 0a9a070c..4ddb344d 100644 --- a/commands/search/anime.js +++ b/commands/search/anime.js @@ -22,8 +22,7 @@ module.exports = class AnimeCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { text } = await snekfetch .get('https://kitsu.io/api/edge/anime') diff --git a/commands/search/bot-info.js b/commands/search/bot-info.js index afa33963..c174360d 100644 --- a/commands/search/bot-info.js +++ b/commands/search/bot-info.js @@ -21,8 +21,7 @@ module.exports = class BotSearchCommand extends Command { }); } - async run(msg, args) { - const { bot } = args; + async run(msg, { bot }) { try { const { body } = await snekfetch .get(`https://bots.discord.pw/api/bots/${bot.id}`) diff --git a/commands/search/bulbapedia.js b/commands/search/bulbapedia.js index c42018de..49cefc9c 100644 --- a/commands/search/bulbapedia.js +++ b/commands/search/bulbapedia.js @@ -22,8 +22,7 @@ module.exports = class BulbapediaCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://bulbapedia.bulbagarden.net/w/api.php') diff --git a/commands/search/define.js b/commands/search/define.js index 41f820bf..208b1f1f 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -22,8 +22,7 @@ module.exports = class DefineCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get(`http://api.wordnik.com:80/v4/word.json/${query}/definitions`) diff --git a/commands/search/discrim.js b/commands/search/discrim.js index 235c68d4..1567b225 100644 --- a/commands/search/discrim.js +++ b/commands/search/discrim.js @@ -25,8 +25,8 @@ module.exports = class DiscrimCommand extends Command { }); } - run(msg, args) { - const discrim = args.discrim || msg.author.discriminator; + run(msg, { discrim }) { + if (!discrim) discrim = msg.author.discriminator; const users = this.client.users.filter(user => user.discriminator === discrim).map(user => user.username); return msg.say(stripIndents` **Found ${users.length} users with the discriminator #${discrim}** diff --git a/commands/search/giphy.js b/commands/search/giphy.js index b264bdcb..34935da4 100644 --- a/commands/search/giphy.js +++ b/commands/search/giphy.js @@ -19,8 +19,7 @@ module.exports = class GiphyCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('http://api.giphy.com/v1/gifs/search') diff --git a/commands/search/github.js b/commands/search/github.js index 1e868bd0..608d9396 100644 --- a/commands/search/github.js +++ b/commands/search/github.js @@ -28,8 +28,7 @@ module.exports = class GitHubCommand extends Command { }); } - async run(msg, args) { - const { author, repository } = args; + async run(msg, { author, repository }) { try { const { body } = await snekfetch .get(`https://${GITHUB_LOGIN}@api.github.com/repos/${author}/${repository}`); diff --git a/commands/search/itunes.js b/commands/search/itunes.js index 84e8b322..0185070b 100644 --- a/commands/search/itunes.js +++ b/commands/search/itunes.js @@ -33,8 +33,7 @@ module.exports = class iTunesCommand extends Command { }); } - async run(msg, args) { - const { country, query } = args; + async run(msg, { country, query }) { try { const { text } = await snekfetch .get('https://itunes.apple.com/search') diff --git a/commands/search/manga.js b/commands/search/manga.js index 0a46b29d..441bd2b9 100644 --- a/commands/search/manga.js +++ b/commands/search/manga.js @@ -22,8 +22,7 @@ module.exports = class MangaCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { text } = await snekfetch .get('https://kitsu.io/api/edge/manga') diff --git a/commands/search/map.js b/commands/search/map.js index be8e45e6..420eab39 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -30,8 +30,7 @@ module.exports = class MapCommand extends Command { }); } - async run(msg, args) { - const { zoom, query } = args; + async run(msg, { zoom, query }) { try { const { body } = await snekfetch .get('https://maps.googleapis.com/maps/api/staticmap') diff --git a/commands/search/mdn.js b/commands/search/mdn.js index 6d590968..e4afe5a2 100644 --- a/commands/search/mdn.js +++ b/commands/search/mdn.js @@ -21,8 +21,7 @@ module.exports = class MDNCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://developer.mozilla.org/en-US/search.json') diff --git a/commands/search/movie.js b/commands/search/movie.js index b06c0af4..dbab72b1 100644 --- a/commands/search/movie.js +++ b/commands/search/movie.js @@ -23,8 +23,7 @@ module.exports = class MovieCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const search = await snekfetch .get('http://api.themoviedb.org/3/search/movie') diff --git a/commands/search/nasa.js b/commands/search/nasa.js index 6e40432c..26d73612 100644 --- a/commands/search/nasa.js +++ b/commands/search/nasa.js @@ -21,8 +21,7 @@ module.exports = class NASACommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://images-api.nasa.gov/search') diff --git a/commands/search/neopet.js b/commands/search/neopet.js index d218355b..2022ddb4 100644 --- a/commands/search/neopet.js +++ b/commands/search/neopet.js @@ -18,8 +18,7 @@ module.exports = class NeopetCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { text } = await snekfetch .get('http://www.sunnyneo.com/petimagefinder.php') diff --git a/commands/search/npm.js b/commands/search/npm.js index 4632b25d..ad139c49 100644 --- a/commands/search/npm.js +++ b/commands/search/npm.js @@ -22,8 +22,7 @@ module.exports = class NPMCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get(`https://registry.npmjs.com/${query}`); diff --git a/commands/search/osu.js b/commands/search/osu.js index 5b37887f..547264c9 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -22,8 +22,7 @@ module.exports = class OsuCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://osu.ppy.sh/api/get_user') diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index 4d9228cd..db3bb8a6 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -24,8 +24,7 @@ module.exports = class PokedexCommand extends Command { }); } - async run(msg, args) { - const { pokemon } = args; + async run(msg, { pokemon }) { try { const { body } = await snekfetch .get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`); diff --git a/commands/search/recipe.js b/commands/search/recipe.js index e8dd966d..9f98a284 100644 --- a/commands/search/recipe.js +++ b/commands/search/recipe.js @@ -20,9 +20,8 @@ module.exports = class RecipeCommand extends Command { }); } - async run(msg, args) { + async run(msg, { query }) { try { - const { query } = args; const { text } = await snekfetch .get('http://www.recipepuppy.com/api/') .query({ q: query }); diff --git a/commands/search/reddit.js b/commands/search/reddit.js index 2d6cde09..8011b079 100644 --- a/commands/search/reddit.js +++ b/commands/search/reddit.js @@ -21,9 +21,8 @@ module.exports = class RedditCommand extends Command { }); } - async run(msg, args) { + async run(msg, { subreddit }) { try { - const { subreddit } = args; const { body } = await snekfetch .get(`https://www.reddit.com/r/${subreddit}/new.json`) .query({ sort: 'new' }); diff --git a/commands/search/steam.js b/commands/search/steam.js index 88483d3a..336b2337 100644 --- a/commands/search/steam.js +++ b/commands/search/steam.js @@ -20,8 +20,7 @@ module.exports = class SteamCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://store.steampowered.com/api/storesearch') diff --git a/commands/search/stocks.js b/commands/search/stocks.js index 8a4db39a..1ab678e3 100644 --- a/commands/search/stocks.js +++ b/commands/search/stocks.js @@ -21,8 +21,7 @@ module.exports = class StocksCommand extends Command { }); } - async run(msg, args) { - const { symbol } = args; + async run(msg, { symbol }) { try { const { body } = await snekfetch .get('https://www.alphavantage.co/query') diff --git a/commands/search/tv-show.js b/commands/search/tv-show.js index 449514e4..a02d770b 100644 --- a/commands/search/tv-show.js +++ b/commands/search/tv-show.js @@ -23,8 +23,7 @@ module.exports = class TVShowCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const search = await snekfetch .get('http://api.themoviedb.org/3/search/tv') diff --git a/commands/search/urban.js b/commands/search/urban.js index c3c55c57..d66cc142 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -21,8 +21,7 @@ module.exports = class UrbanCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('http://api.urbandictionary.com/v0/define') diff --git a/commands/search/vocaloid.js b/commands/search/vocaloid.js index 7902e9be..3fc8386d 100644 --- a/commands/search/vocaloid.js +++ b/commands/search/vocaloid.js @@ -21,8 +21,7 @@ module.exports = class VocaloidCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('http://vocadb.net/api/songs') diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index 5d2141cc..a7c12c9d 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -22,8 +22,7 @@ module.exports = class WattpadCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://api.wattpad.com:443/v4/stories') diff --git a/commands/search/weather.js b/commands/search/weather.js index 7b6d852c..912f4bdf 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -33,8 +33,7 @@ module.exports = class WeatherCommand extends Command { }); } - async run(msg, args) { - const { type, query } = args; + async run(msg, { type, query }) { try { const { body } = await snekfetch .get('http://api.openweathermap.org/data/2.5/weather') diff --git a/commands/search/wikia.js b/commands/search/wikia.js index 163b60a0..6468465e 100644 --- a/commands/search/wikia.js +++ b/commands/search/wikia.js @@ -28,8 +28,7 @@ module.exports = class WikiaCommand extends Command { }); } - async run(msg, args) { - const { wiki, query } = args; + async run(msg, { wiki, query }) { try { const search = await snekfetch .get(`http://${wiki}.wikia.com/api/v1/Search/List/`) diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 64539b97..2fa70c63 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -21,8 +21,7 @@ module.exports = class WikipediaCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://en.wikipedia.org/w/api.php') diff --git a/commands/search/youtube.js b/commands/search/youtube.js index d1b0c0fb..b77dda0e 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -21,8 +21,7 @@ module.exports = class YouTubeCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get('https://www.googleapis.com/youtube/v3/search') diff --git a/commands/search/yu-gi-oh.js b/commands/search/yu-gi-oh.js index e751bb69..281f151b 100644 --- a/commands/search/yu-gi-oh.js +++ b/commands/search/yu-gi-oh.js @@ -21,8 +21,7 @@ module.exports = class YuGiOhCommand extends Command { }); } - async run(msg, args) { - const { query } = args; + async run(msg, { query }) { try { const { body } = await snekfetch .get(`http://yugiohprices.com/api/card_data/${query}`); diff --git a/commands/text-edit/b.js b/commands/text-edit/b.js index 8c65fbe1..228e6c3f 100644 --- a/commands/text-edit/b.js +++ b/commands/text-edit/b.js @@ -22,8 +22,7 @@ module.exports = class BCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(text.replace(/(b|d|g|p|q)/gi, '🅱')); } }; diff --git a/commands/text-edit/binary.js b/commands/text-edit/binary.js index e4c09136..8b7ce65e 100644 --- a/commands/text-edit/binary.js +++ b/commands/text-edit/binary.js @@ -21,8 +21,7 @@ module.exports = class BinaryCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(this.binary(text)); } diff --git a/commands/text-edit/clap.js b/commands/text-edit/clap.js index 43dec637..e98d9e96 100644 --- a/commands/text-edit/clap.js +++ b/commands/text-edit/clap.js @@ -14,7 +14,7 @@ module.exports = class ClapCommand extends Command { prompt: 'What 👏 text 👏 would 👏 you 👏 like 👏 to 👏 convert?', type: 'string', validate: text => { - if (text.split(' ').join(' 👏 ').length < 2000) return true; + if (text.replace(/ /g, ' 👏 ').length < 2000) return true; return 'Invalid text, your text is too long.'; } } @@ -22,8 +22,7 @@ module.exports = class ClapCommand extends Command { }); } - run(msg, args) { - const { text } = args; - return msg.say(text.split(' ').join(' 👏 ')); + run(msg, { text }) { + return msg.say(text.replace(/ /g, ' 👏 ')); } }; diff --git a/commands/text-edit/cow-say.js b/commands/text-edit/cow-say.js index 17c801f8..f4468a6c 100644 --- a/commands/text-edit/cow-say.js +++ b/commands/text-edit/cow-say.js @@ -22,8 +22,7 @@ module.exports = class CowsayCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.code(null, stripIndent` < ${text} > diff --git a/commands/text-edit/embed.js b/commands/text-edit/embed.js index e4f601c5..5ecf7d2b 100644 --- a/commands/text-edit/embed.js +++ b/commands/text-edit/embed.js @@ -19,8 +19,7 @@ module.exports = class EmbedCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { const embed = new MessageEmbed() .setAuthor(msg.author.tag, msg.author.displayAvatarURL) .setColor(0x00AE86) diff --git a/commands/text-edit/emojify.js b/commands/text-edit/emojify.js index 572fa8fe..3008828a 100644 --- a/commands/text-edit/emojify.js +++ b/commands/text-edit/emojify.js @@ -25,8 +25,7 @@ module.exports = class EmojifyCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(letterTrans(text, dictionary, ' ')); } }; diff --git a/commands/text-edit/mocking.js b/commands/text-edit/mocking.js index 8c176ed7..a9ca6fed 100644 --- a/commands/text-edit/mocking.js +++ b/commands/text-edit/mocking.js @@ -24,8 +24,7 @@ module.exports = class MockingCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { for (let i = 0; i < text.length; i += Math.floor(Math.random() * 4)) text[i] = text[i].toUpperCase(); return msg.say(`${text.join('')} <:sponge:318612443398144000>`); } diff --git a/commands/text-edit/morse.js b/commands/text-edit/morse.js index 41fd3c78..0fece3d4 100644 --- a/commands/text-edit/morse.js +++ b/commands/text-edit/morse.js @@ -24,8 +24,7 @@ module.exports = class MorseCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(letterTrans(text, dictionary, ' ')); } }; diff --git a/commands/text-edit/organization-xiii-name.js b/commands/text-edit/organization-xiii-name.js index f2c1c312..3b4337b1 100644 --- a/commands/text-edit/organization-xiii-name.js +++ b/commands/text-edit/organization-xiii-name.js @@ -20,8 +20,7 @@ module.exports = class OrganizationXIIINameCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { text.push('x'); const shuffled = shuffle(text); shuffled[0] = shuffled[0].toUpperCase(); diff --git a/commands/text-edit/pirate.js b/commands/text-edit/pirate.js index d0faf3a8..e9111002 100644 --- a/commands/text-edit/pirate.js +++ b/commands/text-edit/pirate.js @@ -23,8 +23,7 @@ module.exports = class PirateCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(wordTrans(text, dictionary)); } }; diff --git a/commands/text-edit/repeat.js b/commands/text-edit/repeat.js index af8a8d72..d922860e 100644 --- a/commands/text-edit/repeat.js +++ b/commands/text-edit/repeat.js @@ -21,8 +21,7 @@ module.exports = class RepeatCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(text.repeat(2000).substr(0, 2000)); } }; diff --git a/commands/text-edit/reverse.js b/commands/text-edit/reverse.js index bdfec04c..8d1c723e 100644 --- a/commands/text-edit/reverse.js +++ b/commands/text-edit/reverse.js @@ -17,8 +17,7 @@ module.exports = class ReverseCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(text.split('').reverse().join('')); } }; diff --git a/commands/text-edit/say.js b/commands/text-edit/say.js index 43643f63..31aca2c0 100644 --- a/commands/text-edit/say.js +++ b/commands/text-edit/say.js @@ -18,8 +18,7 @@ module.exports = class SayCommand extends Command { }); } - async run(msg, args) { - const { text } = args; + async run(msg, { text }) { if (msg.channel.type === 'text' && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) { await msg.delete(); } diff --git a/commands/text-edit/ship-name.js b/commands/text-edit/ship-name.js index ff824bbf..9b5f7d68 100644 --- a/commands/text-edit/ship-name.js +++ b/commands/text-edit/ship-name.js @@ -32,8 +32,7 @@ module.exports = class ShipNameCommand extends Command { }); } - run(msg, args) { - const { start, end } = args; + run(msg, { start, end }) { return msg.say(`${start.slice(0, Math.floor(start.length / 2))}${end.slice(Math.floor(end.length / 2))}`); } }; diff --git a/commands/text-edit/shuffle.js b/commands/text-edit/shuffle.js index 4a80a55f..bca2f9c0 100644 --- a/commands/text-edit/shuffle.js +++ b/commands/text-edit/shuffle.js @@ -18,8 +18,7 @@ module.exports = class ShuffleCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(shuffle(text.split('')).join('')); } }; diff --git a/commands/text-edit/temmie.js b/commands/text-edit/temmie.js index e4890522..9831ac86 100644 --- a/commands/text-edit/temmie.js +++ b/commands/text-edit/temmie.js @@ -23,8 +23,7 @@ module.exports = class TemmieCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(wordTrans(text, dictionary)); } }; diff --git a/commands/text-edit/translate.js b/commands/text-edit/translate.js index a8dc50b9..bcd19205 100644 --- a/commands/text-edit/translate.js +++ b/commands/text-edit/translate.js @@ -55,8 +55,7 @@ module.exports = class TranslateCommand extends Command { }); } - async run(msg, args) { - const { text, target, base } = args; + async run(msg, { text, target, base }) { try { const { body } = await snekfetch .get('https://translate.yandex.net/api/v1.5/tr.json/translate') diff --git a/commands/text-edit/upside-down.js b/commands/text-edit/upside-down.js index 380eac28..82bb50ac 100644 --- a/commands/text-edit/upside-down.js +++ b/commands/text-edit/upside-down.js @@ -20,8 +20,7 @@ module.exports = class UpsideDownCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(letterTrans(text, dictionary)); } }; diff --git a/commands/text-edit/webhook.js b/commands/text-edit/webhook.js index 1340d559..95063720 100644 --- a/commands/text-edit/webhook.js +++ b/commands/text-edit/webhook.js @@ -21,8 +21,7 @@ module.exports = class WebhookCommand extends Command { }); } - async run(msg, args) { - const { content } = args; + async run(msg, { content }) { if (msg.channel.type === 'text' && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) { await msg.delete(); } diff --git a/commands/text-edit/yoda.js b/commands/text-edit/yoda.js index 367f3dce..cceaaa2c 100644 --- a/commands/text-edit/yoda.js +++ b/commands/text-edit/yoda.js @@ -24,8 +24,7 @@ module.exports = class YodaCommand extends Command { }); } - async run(msg, args) { - const { sentence } = args; + async run(msg, { sentence }) { try { const { text } = await snekfetch .get('https://yoda.p.mashape.com/yoda') diff --git a/commands/text-edit/zalgo.js b/commands/text-edit/zalgo.js index 2f80099c..d19de05f 100644 --- a/commands/text-edit/zalgo.js +++ b/commands/text-edit/zalgo.js @@ -22,8 +22,7 @@ module.exports = class ZalgoCommand extends Command { }); } - run(msg, args) { - const { text } = args; + run(msg, { text }) { return msg.say(zalgo(text)); } }; diff --git a/commands/user-info/avatar.js b/commands/user-info/avatar.js index b1787d80..37c5ba04 100644 --- a/commands/user-info/avatar.js +++ b/commands/user-info/avatar.js @@ -18,8 +18,8 @@ module.exports = class AvatarCommand extends Command { }); } - run(msg, args) { - const user = args.user || msg.author; + run(msg, { user }) { + if (!user) user = msg.author; if (!user.avatar) return msg.say('This user has no avatar.'); const avatar = user.avatarURL({ format: user.avatar.startsWith('a_') ? 'gif' : 'png', diff --git a/commands/user-info/user-info.js b/commands/user-info/user-info.js index 6177f704..35e5aeaa 100644 --- a/commands/user-info/user-info.js +++ b/commands/user-info/user-info.js @@ -28,8 +28,8 @@ module.exports = class UserInfoCommand extends Command { }); } - run(msg, args) { - const member = args.member || msg.member; + run(msg, { member }) { + if (!member) member = msg.member; const embed = new MessageEmbed() .setColor(member.displayHexColor) .setThumbnail(member.user.displayAvatarURL()) diff --git a/commands/util/help.js b/commands/util/help.js index f057bb4c..3ce905c4 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -23,8 +23,7 @@ module.exports = class HelpCommand extends Command { }); } - async run(msg, args) { - const { command } = args; + async run(msg, { command }) { const commands = this.client.registry.findCommands(command, false, msg); if (command) { if (commands.length === 1) { diff --git a/commands/util/shard-info.js b/commands/util/shard-info.js index 2ffd76ed..d7b080b6 100644 --- a/commands/util/shard-info.js +++ b/commands/util/shard-info.js @@ -26,8 +26,7 @@ module.exports = class ShardInfoCommand extends Command { }); } - async run(msg, args) { - const { shard } = args; + async run(msg, { shard }) { const memory = await this.client.shard.broadcastEval('process.memoryUsage().heapUsed'); const uptime = await this.client.shard.fetchClientValues('uptime'); const guilds = await this.client.shard.fetchClientValues('guilds.size'); diff --git a/package.json b/package.json index 1b604197..b544e609 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "39.0.0", + "version": "39.0.1", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {