This commit is contained in:
Dragon Fire
2021-06-09 22:17:28 -04:00
parent 43bbf79214
commit 9d40245696
6 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ module.exports = class AnimeScoreCommand extends Command {
.setImage(anime.coverImage.large || anime.coverImage.medium || null)
.setTitle(anime.title.english || anime.title.romaji)
.setDescription(`_${anime.startDate.year}, ${formats[anime.format]}_`)
.setFooter(anime.id);
.setFooter(anime.id.toString());
await msg.reply('**You have 15 seconds, what score do you think this anime has?**', { embed });
const filter = res => {
if (res.author.id !== msg.author.id) return false;
+1
View File
@@ -1,4 +1,5 @@
const Command = require('../../framework/Command');
const { MessageActionRow, MessageButton } = require('discord.js');
const { stripIndents } = require('common-tags');
const { shuffle, removeDuplicates, verify } = require('../../util/Util');
const events = require('../../assets/json/hunger-games');
+1 -1
View File
@@ -127,7 +127,7 @@ module.exports = class AnimeCommand extends Command {
.setTitle(anime.title.english || anime.title.romaji)
.setDescription(anime.description ? cleanAnilistHTML(anime.description) : 'No description.')
.addField(' Status', statuses[anime.status], true)
.addField(' Episodes', anime.episodes || '???', true)
.addField(' Episodes', anime.episodes?.toString() || '???', true)
.addField(' Season', anime.season ? `${seasons[anime.season]} ${anime.startDate.year}` : '???', true)
.addField(' Average Score', anime.averageScore ? `${anime.averageScore}%` : '???', true)
.addField(` MAL Score`, malScore ? embedURL(malScore, malURL) : '???', true)
+1 -1
View File
@@ -121,7 +121,7 @@ module.exports = class MangaCommand extends Command {
.setDescription(manga.description ? cleanAnilistHTML(manga.description) : 'No description.')
.addField(' Status', statuses[manga.status], true)
.addField(' Chapters / Volumes', `${manga.chapters || '???'}/${manga.volumes || '???'}`, true)
.addField(' Year', manga.startDate.year || '???', true)
.addField(' Year', manga.startDate.year?.toString() || '???', true)
.addField(' Average Score', manga.averageScore ? `${manga.averageScore}%` : '???', true)
.addField(` MAL Score`, malScore ? embedURL(malScore, malURL) : '???', true)
.addField(` ${ANILIST_USERNAME}'s Score`, entry && entry.score ? `${entry.score}/10` : '???', true)
+5 -3
View File
@@ -39,9 +39,8 @@ module.exports = class CommandDispatcher {
for (let i = 0; i < command.args.length; i++) {
const arg = command.args[i];
if (arg.infinite) {
const infinite = parsed._.slice(i).map(j => j.toString());
const parsedArgs = [];
for (const parsedArg of infinite) {
const infinite = parsed._.slice(i);
if (!infinite.length) {
if (arg.isEmpty(parsedArg, msg, arg)) {
if (arg.default) {
finalResult[arg.key] = typeof arg.default === 'function' ? arg.default(msg) : arg.default;
@@ -50,6 +49,9 @@ module.exports = class CommandDispatcher {
return `The "${arg.label || arg.key}" argument is required.`;
}
}
}
const parsedArgs = [];
for (const parsedArg of infinite) {
const valid = await arg.validate(parsedArg, msg, arg);
if (!valid) return `An invalid value was provided for one of the "${arg.label || arg.key}" arguments.`;
parsedArgs.push(await arg.parse(parsedArg, msg, arg));
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "141.0.0",
"version": "141.0.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"private": true,