diff --git a/assets/json/be-like-bill.json b/assets/json/be-like-bill.json index 615cbd07..c44a0aa3 100644 --- a/assets/json/be-like-bill.json +++ b/assets/json/be-like-bill.json @@ -8,7 +8,7 @@ "{{name}} does not play Candy Crush.\n{{name}} has a life.", "{{name}} is a jerk.", "{{name}} wakes up and sees it snowing outside.\n{{name}} doesn't post about it because\nhe knows his friends also have windows.", - "{{name}} knows tomorrow is Monday.\n{{name}} doesn't post about it, becuase\nhe knows it happens every week.", + "{{name}} knows tomorrow is Monday.\n{{name}} doesn't post about it, because\nhe knows it happens every week.", "{{name}} doesn't shout at the TV\nwhen football is on.\n{{name}} knows they can't hear him.", "{{name}} pays attention in class instead of\nchatting with his friends on Discord.", "{{name}} has a good camera.\n{{name}} doesn't take useless photos\nand call himself a photographer.", diff --git a/commands/analyze/what-anime.js b/commands/analyze/what-anime.js index 04f35d7d..35031d76 100644 --- a/commands/analyze/what-anime.js +++ b/commands/analyze/what-anime.js @@ -31,10 +31,12 @@ module.exports = class WhatAnimeCommand extends Command { const { body } = await request.get(screenshot); const result = await this.search(body, msg.channel.nsfw); if (result === 'size') return msg.reply('Please do not send an image larger than 1MB.'); - if (result === 'nsfw') return msg.reply('This is from a hentai, and this isn\'t an NSFW channel, pervert.'); + if (result.nsfw) return msg.reply('This is from a hentai, and this isn\'t an NSFW channel, pervert.'); return msg.reply( - `I'm ${result.probability}% sure this is from ${result.title} (${result.english}) episode #${result.episode}.`, - result.preview ? { files: [{ attachment: result.preview, name: 'anime.mp4' }] } : {} + `I'm ${result.prob}% sure this is from ${result.title}${result.episode + ? ` episode ${result.episode}` + : ''}.`, + result.preview ? { files: [{ attachment: result.preview, name: 'preview.mp4' }] } : {} ); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); @@ -52,20 +54,17 @@ module.exports = class WhatAnimeCommand extends Command { } } - async search(file, nsfw) { + async search(file) { if (Buffer.byteLength(file) > 1e+6) return 'size'; const { body } = await request .post('https://whatanime.ga/api/search') .query({ token: WHATANIME_KEY }) .attach('image', base64(file)); const data = body.docs[0]; - if (data.is_adult && !nsfw) return 'nsfw'; return { - time: data.at * 1000, - probability: Math.round(data.similarity * 100), + prob: Math.round(data.similarity * 100), episode: data.episode, - title: data.title_native, - english: data.title_english, + title: data.title_english, preview: await this.fetchPreview(data), nsfw: data.is_adult }; diff --git a/commands/number-edit/currency.js b/commands/number-edit/currency.js index d33abcc9..09414836 100644 --- a/commands/number-edit/currency.js +++ b/commands/number-edit/currency.js @@ -37,9 +37,9 @@ module.exports = class CurrencyCommand extends Command { async run(msg, { base, target, amount }) { try { if (!this.currencies) await this.fetchCurrencies(); - base = this.currencies[base] || this.currencies.find($ => $.currencyName.toLowerCase() === base); + base = this.currencies[base]; if (!base) return msg.say('Invalid base.'); - target = this.currencies[target] || this.currencies.find($ => $.currencyName.toLowerCase() === target); + target = this.currencies[target]; if (!target) return msg.say('Invalid target.'); if (base.id === target.id) return msg.say(`Converting ${base.id} to ${target.id} is the same value, dummy.`); const rate = await this.fetchRate(base, target); diff --git a/commands/random/quantum-coin.js b/commands/random/quantum-coin.js index 37f74b84..b08f40c4 100644 --- a/commands/random/quantum-coin.js +++ b/commands/random/quantum-coin.js @@ -1,5 +1,5 @@ const Command = require('../../structures/Command'); -const sides = [NaN, 0, null, undefined, '']; +const sides = ['NaN', '0', 'null', 'undefined', '\'\'']; module.exports = class QuantumCoinCommand extends Command { constructor(client) { diff --git a/package.json b/package.json index a46cb354..19ffc7fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "85.4.0", + "version": "85.4.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { diff --git a/structures/Command.js b/structures/Command.js index 97bbf6f9..b4086684 100644 --- a/structures/Command.js +++ b/structures/Command.js @@ -2,7 +2,6 @@ const { Command } = require('discord.js-commando'); class XiaoCommand extends Command { constructor(client, info) { - if (typeof info.argsPromptLimit === 'undefined') info.argsPromptLimit = 0; super(client, info); this.argsSingleQuotes = info.argsSingleQuotes || false;