diff --git a/commands/events/neko-atsume-password.js b/commands/events/neko-atsume-password.js index 22191bf6..ee2887f0 100644 --- a/commands/events/neko-atsume-password.js +++ b/commands/events/neko-atsume-password.js @@ -42,7 +42,7 @@ module.exports = class NekoAtsumePasswordCommand extends Command { async fetchPassword(locale) { const { text } = await request - .get(`http://hpmobile.jp/app/nekoatsume/neko_daily${locale !== 'jp' ? `_${locale}` : ''}.php`); + .get(`http://hpmobile.jp/app/nekoatsume/neko_daily${locale === 'jp' ? '' : `_${locale}`}.php`); const data = text.split(','); const date = new Date(); date.setUTCHours(date.getUTCHours() + 9); diff --git a/commands/games/battle.js b/commands/games/battle.js index 4df927ba..0800151e 100644 --- a/commands/games/battle.js +++ b/commands/games/battle.js @@ -88,12 +88,12 @@ module.exports = class BattleCommand extends Command { reset(false); } else if (choice === 'special') { const miss = Math.floor(Math.random() * 4); - if (!miss) { + if (miss) { + await msg.say(`${user}'s attack missed!`); + } else { const damage = randomRange(100, guard ? 150 : 300); await msg.say(`${user} deals **${damage}** damage!`); dealDamage(damage); - } else { - await msg.say(`${user}'s attack missed!`); } reset(); } else if (choice === 'run') { diff --git a/commands/games/roulette.js b/commands/games/roulette.js index 7ab2164e..fb25942d 100644 --- a/commands/games/roulette.js +++ b/commands/games/roulette.js @@ -41,7 +41,7 @@ module.exports = class RouletteCommand extends Command { run(msg, { space }) { const number = Math.floor(Math.random() * 37); - const color = !number ? null : red.includes(number) ? 'RED' : 'BLACK'; + const color = number ? red.includes(number) ? 'RED' : 'BLACK' : null; const win = this.verifyWin(space, number); return msg.reply(`The result is **${number}${color ? ` ${color}` : ''}**. ${win ? 'You win!' : 'You lose...'}`); } diff --git a/commands/info/user.js b/commands/info/user.js index 72eb108e..0bda90dc 100644 --- a/commands/info/user.js +++ b/commands/info/user.js @@ -36,7 +36,7 @@ module.exports = class UserInfoCommand extends Command { .addField('❯ Server Join Date', member.joinedAt.toDateString(), true) .addField('❯ Nickname', member.nickname || 'None', true) .addField('❯ Highest Role', - member.roles.highest.id !== msg.guild.defaultRole.id ? member.roles.highest.name : 'None', true) + member.roles.highest.id === msg.guild.defaultRole.id ? 'None' : member.roles.highest.name, true) .addField('❯ Hoist Role', member.roles.hoist ? member.roles.hoist.name : 'None', true); } catch (err) { embed.setFooter('Failed to resolve member, showing basic user information instead.'); diff --git a/commands/text-edit/portal-send.js b/commands/text-edit/portal-send.js index e7b1239d..043d9e1f 100644 --- a/commands/text-edit/portal-send.js +++ b/commands/text-edit/portal-send.js @@ -28,7 +28,7 @@ module.exports = class PortalSendCommand extends Command { if (!channels.size) return msg.reply('No channels have an open portal...'); const channel = channels.random(); try { - await channel.send(`**${msg.author.tag} (${msg.channel.type !== 'text' ? 'DM' : msg.guild.name})**: ${message}`); + await channel.send(`**${msg.author.tag} (${msg.channel.type === 'text' ? msg.guild.name : 'DM'})**: ${message}`); return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`); } catch (err) { return msg.reply('Failed to send the message. Try again later!'); diff --git a/package.json b/package.json index 0b5617f1..5df5017e 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ }, "devDependencies": { "eslint": "^5.3.0", - "eslint-config-amber": "^1.0.4", + "eslint-config-amber": "^1.1.0", "eslint-plugin-json": "^1.2.1" }, "eslintConfig": {