From 300411824d9f7d029572df0570b2d915d89891c7 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 9 Jun 2017 02:32:10 +0000 Subject: [PATCH] Cats --- commands/avataredit/3000-years.js | 2 +- commands/avataredit/beautiful.js | 2 +- commands/avataredit/bob-ross.js | 2 +- commands/avataredit/card.js | 2 +- commands/avataredit/challenger.js | 2 +- commands/avataredit/dexter.js | 2 +- commands/avataredit/greyscale.js | 2 +- commands/avataredit/invert.js | 2 +- commands/avataredit/rip.js | 2 +- commands/avataredit/simba.js | 2 +- commands/avataredit/steam-card.js | 4 ++-- commands/avataredit/triggered.js | 4 ++-- commands/avataredit/wanted.js | 4 ++-- commands/games/battle.js | 8 ++++++-- commands/games/math-game.js | 7 +++---- commands/games/quiz.js | 6 +++--- commands/games/typing-game.js | 6 +++--- commands/moderation/ban.js | 4 ++-- commands/moderation/kick.js | 4 ++-- commands/moderation/softban.js | 4 ++-- commands/moderation/unban.js | 4 ++-- commands/moderation/warn.js | 4 ++-- commands/random/star.js | 6 ++++-- commands/util/help.js | 2 +- package.json | 2 +- 25 files changed, 47 insertions(+), 42 deletions(-) diff --git a/commands/avataredit/3000-years.js b/commands/avataredit/3000-years.js index e136b45c..f436e356 100644 --- a/commands/avataredit/3000-years.js +++ b/commands/avataredit/3000-years.js @@ -32,7 +32,7 @@ module.exports = class YearsCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index 5c9db62f..2eb73bd3 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -32,7 +32,7 @@ module.exports = class BeautifulCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/bob-ross.js b/commands/avataredit/bob-ross.js index 380be550..e0fe2df1 100644 --- a/commands/avataredit/bob-ross.js +++ b/commands/avataredit/bob-ross.js @@ -32,7 +32,7 @@ module.exports = class BobRossCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/card.js b/commands/avataredit/card.js index 788e558f..4b51f1b8 100644 --- a/commands/avataredit/card.js +++ b/commands/avataredit/card.js @@ -35,7 +35,7 @@ module.exports = class CardCommand extends Command { async run(msg, args) { const member = args.member || msg.member; const avatarURL = member.user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const cardID = Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000; diff --git a/commands/avataredit/challenger.js b/commands/avataredit/challenger.js index c88b53cf..4709f05e 100644 --- a/commands/avataredit/challenger.js +++ b/commands/avataredit/challenger.js @@ -31,7 +31,7 @@ module.exports = class ChallengerCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/dexter.js b/commands/avataredit/dexter.js index 448d4148..06b17c81 100644 --- a/commands/avataredit/dexter.js +++ b/commands/avataredit/dexter.js @@ -31,7 +31,7 @@ module.exports = class DexterCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/greyscale.js b/commands/avataredit/greyscale.js index 2588d532..965e903d 100644 --- a/commands/avataredit/greyscale.js +++ b/commands/avataredit/greyscale.js @@ -29,7 +29,7 @@ module.exports = class GreyscaleCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/invert.js b/commands/avataredit/invert.js index 6ba9a5e8..967e7e2d 100644 --- a/commands/avataredit/invert.js +++ b/commands/avataredit/invert.js @@ -28,7 +28,7 @@ module.exports = class InvertCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index 2b96fc68..5bfc09e9 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -32,7 +32,7 @@ module.exports = class RIPCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/simba.js b/commands/avataredit/simba.js index ea65e9c0..a4817371 100644 --- a/commands/avataredit/simba.js +++ b/commands/avataredit/simba.js @@ -31,7 +31,7 @@ module.exports = class SimbaCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', + format: 'png', size: 256 }); const Image = Canvas.Image; diff --git a/commands/avataredit/steam-card.js b/commands/avataredit/steam-card.js index 65c97db2..46493cc6 100644 --- a/commands/avataredit/steam-card.js +++ b/commands/avataredit/steam-card.js @@ -31,8 +31,8 @@ module.exports = class SteamCardCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', - size: 256 + format: 'png', + size: 512 }); const Image = Canvas.Image; Canvas.registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' }); // eslint-disable-line max-len diff --git a/commands/avataredit/triggered.js b/commands/avataredit/triggered.js index 0827aeca..338cd931 100644 --- a/commands/avataredit/triggered.js +++ b/commands/avataredit/triggered.js @@ -31,8 +31,8 @@ module.exports = class TriggeredCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', - size: 256 + format: 'png', + size: 512 }); const Image = Canvas.Image; const canvas = new Canvas(320, 371); diff --git a/commands/avataredit/wanted.js b/commands/avataredit/wanted.js index 29661611..ebe74193 100644 --- a/commands/avataredit/wanted.js +++ b/commands/avataredit/wanted.js @@ -31,8 +31,8 @@ module.exports = class WantedCommand extends Command { async run(msg, args) { const user = args.user || msg.author; const avatarURL = user.displayAvatarURL({ - format: 'png', - size: 256 + format: 'png', + size: 512 }); const Image = Canvas.Image; const canvas = new Canvas(741, 1000); diff --git a/commands/games/battle.js b/commands/games/battle.js index dbaeb4a4..d97de26c 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -101,8 +101,12 @@ module.exports = class BattleCommand extends Command { this.fighting.delete(msg.guild.id); return msg.say(stripIndents` The match is over! - **Winner:** ${userHP > oppoHP ? `${msg.author.username} (${userHP}HP)` : `${opponent.username} (${oppoHP}HP)`} - **Loser:** ${userHP > oppoHP ? `${opponent.username} (${oppoHP}HP)` : `${msg.author.username} (${userHP}HP)`} + **Winner:** ${userHP > oppoHP ? + `${msg.author.username} (${userHP}HP)` : + `${opponent.username} (${oppoHP}HP)`} + **Loser:** ${userHP > oppoHP ? + `${opponent.username} (${oppoHP}HP)` : + `${msg.author.username} (${userHP}HP)`} `); } }; diff --git a/commands/games/math-game.js b/commands/games/math-game.js index 768ef39b..4149e2f9 100644 --- a/commands/games/math-game.js +++ b/commands/games/math-game.js @@ -38,13 +38,12 @@ module.exports = class MathGameCommand extends Command { .setTitle('You have 10 seconds to answer:') .setDescription(expression); await msg.embed(embed); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 10000 }); - if (!collected.size) return msg.say(`Time! It was ${answer}, sorry!`); - if (collected.first().content !== answer) return msg.say(`Nope, sorry, it's ${answer}.`); + if (!msgs.size) return msg.say(`Time! It was ${answer}, sorry!`); + if (msgs.first().content !== answer) return msg.say(`Nope, sorry, it's ${answer}.`); else return msg.say('Nice job! 10/10! You deserve some cake!'); - } }; diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 563c1543..191d74f0 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -31,12 +31,12 @@ module.exports = class QuizCommand extends Command { True or False: ${decodeURIComponent(body.results[0].question)} `); await msg.embed(embed); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 15000 }); - if (!collected.size) return msg.say(`Time! It was ${answer}, sorry!`); - if (collected.first().content.toLowerCase() !== answer) return msg.say(`Nope, sorry, it's ${answer}.`); + if (!msgs.size) return msg.say(`Time! It was ${answer}, sorry!`); + if (msgs.first().content.toLowerCase() !== answer) return msg.say(`Nope, sorry, it's ${answer}.`); else return msg.say('Nice job! 10/10! You deserve some cake!'); } }; diff --git a/commands/games/typing-game.js b/commands/games/typing-game.js index fa7e045b..4bea2eaa 100644 --- a/commands/games/typing-game.js +++ b/commands/games/typing-game.js @@ -33,12 +33,12 @@ module.exports = class TypingGameCommand extends Command { .setTitle(`You have ${time / 1000} seconds to type:`) .setDescription(sentence); await msg.embed(embed); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time }); - if (!collected.size) return msg.say('Time! Sorry!'); - if (collected.first().content !== sentence) return msg.say('Nope, sorry!'); + if (!msgs.size) return msg.say('Time! Sorry!'); + if (msgs.first().content !== sentence) return msg.say('Nope, sorry!'); else return msg.say('Nice job! 10/10! You deserve some cake!'); } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index be38a5db..10df6555 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -37,11 +37,11 @@ module.exports = class BanCommand extends Command { const { member, reason } = args; if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); await msg.say(`Are you sure you want to ban ${member.user.tag} (${member.id})?`); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 15000 }); - if (!collected.size || !['y', 'yes'].includes(collected.first().content.toLowerCase())) return msg.say('Aborting.'); + if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.'); try { await member.send(stripIndents` You were banned from ${msg.guild.name}! diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 41ac69ff..2f71f765 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -37,11 +37,11 @@ module.exports = class KickCommand extends Command { const { member, reason } = args; if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?'); await msg.say(`Are you sure you want to kick ${member.user.tag} (${member.id})?`); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 15000 }); - if (!collected.size || !['y', 'yes'].includes(collected.first().content.toLowerCase())) return msg.say('Aborting.'); + if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.'); try { await member.send(stripIndents` You were kicked from ${msg.guild.name}! diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 61a3bedd..38e5e2ca 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -37,11 +37,11 @@ module.exports = class SoftbanCommand extends Command { const { member, reason } = args; if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); await msg.say(`Are you sure you want to softban ${member.user.tag} (${member.id})?`); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 15000 }); - if (!collected.size || !['y', 'yes'].includes(collected.first().content.toLowerCase())) return msg.say('Aborting.'); + if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.'); try { await member.send(stripIndents` You were softbanned from ${msg.guild.name}! diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index a8aaa180..03f82634 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -39,11 +39,11 @@ module.exports = class UnbanCommand extends Command { if (!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.'); const member = bans.get(id).user; await msg.say(`Are you sure you want to unban ${member.tag} (${member.id})?`); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 15000 }); - if (!collected.size || !['y', 'yes'].includes(collected.first().content.toLowerCase())) return msg.say('Aborting.'); + if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.'); await msg.guild.unban(member, `${msg.author.tag}: ${reason}`); await msg.say(`Successfully unbanned ${member.user.tag}.`); if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) { diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 75d08aea..e3b5bf72 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -35,11 +35,11 @@ module.exports = class WarnCommand extends Command { const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog')); const { member, reason } = args; await msg.say(`Are you sure you want to warn ${member.user.tag} (${member.id})?`); - const collected = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { + const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, { max: 1, time: 15000 }); - if (!collected.size || !['y', 'yes'].includes(collected.first().content.toLowerCase())) return msg.say('Aborting.'); + if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.'); try { await member.user.send(stripIndents` You were warned in ${msg.guild.name}! diff --git a/commands/random/star.js b/commands/random/star.js index fa568149..a34f34e3 100644 --- a/commands/random/star.js +++ b/commands/random/star.js @@ -25,9 +25,11 @@ module.exports = class StarCommand extends Command { async run(msg, args, reaction) { const { id } = args; const channel = msg.guild.channels.get(msg.guild.settings.get('starboard')); - if (!channel || !channel.permissionsFor(this.client.user).has('SEND_MESSAGES') || this.starred.includes(id)) return null; + if (!channel || + !channel.permissionsFor(this.client.user).has('SEND_MESSAGES') || + this.starred.includes(id)) return null; const message = await msg.channel.fetchMessage(id); - if (!reaction && msg.author.id === message.author.id) return msg.reply('You cannot star your own messages, baka.'); + if (!reaction && msg.author.id === message.author.id) return msg.reply('You cannot star your own messages, baka.'); // eslint-disable-line max-len this.starred.push(id); if (!channel.permissionsFor(this.client.user).has('EMBED_LINKS')) { return msg.say(stripIndents` diff --git a/commands/util/help.js b/commands/util/help.js index a91edaf7..9aca4034 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -43,7 +43,7 @@ module.exports = class HelpCommand extends Command { commands[0].group.name); return msg.embed(embed); } else if (commands.length > 1) { - return msg.say(`Multiple commands found, please be more specific: ${commands.map((c) => c.name).join(', ')}`); + return msg.say(`Multiple commands found: ${commands.map((c) => c.name).join(', ')}`); } else { return msg.say(`Could not identify command. Use ${msg.usage(null)} to view a list of commands.`); } diff --git a/package.json b/package.json index ff798f1c..b08e688d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "22.1.5", + "version": "22.1.6", "description": "A Discord Bot", "main": "Shard.js", "scripts": {