From cb6dad55e07ae1cd2bc8654fabdf4aa6dad3cfb0 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Wed, 29 Dec 2021 19:51:23 -0700 Subject: [PATCH] finished anime list (n?fl v) --- commands/anime/watched.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/commands/anime/watched.js b/commands/anime/watched.js index 93f27a7..b67c566 100644 --- a/commands/anime/watched.js +++ b/commands/anime/watched.js @@ -21,6 +21,28 @@ module.exports = { if (args[0] && ['v', 'view'].includes(args[0].toLowerCase())) { if (mention) {args.shift();} let user = mention || message.author; + let af = await AF.findOne({uid: user.id}); + if (!af || !af.watched.length) {return message.channel.send(`${user.id === message.author.id ? "You haven't" : "That person hasn't"} watched any anime.`);} + let pages = []; + let pl = (Math.floor(af.watched.length / 10) + 1); + for (let i = 0; i < pl; i++) { + let s = ''; + for (let x = 0; x < 10; x++) { + if (!af.watched[(i * 10) + x]) {break;} + s += `**${x + (i * 10) + 1}.** ${client.misc.cache.animeID.get(af.watched[(i * 10) + x])}\n`; + } + pages.push(new Discord.MessageEmbed() + .setAuthor(message.guild ? message.guild.members.cache.get(user.id).displayName : user.username, message.author.displayAvatarURL({dynamic: true})) + .setTitle("Finished Anime List") + .setDescription(s) + .setColor('c375f0') + .setTimestamp() + ); + } + if (pages.length > 1) { + let pag = new Pagination(message.channel, pages, message, client, true); + return await pag.start({user: message.author.id, time: 60000}); + } else {return message.channel.send({embeds: [pages[0].setFooter("Natsuki")]});} } if (!args[0]) {