From a2528914ac6c13b14ec6db5c57fb73695c48d585 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sat, 25 Dec 2021 15:48:07 -0700 Subject: [PATCH] better img output --- commands/anime/char.js | 9 +++++---- commands/anime/charimage.js | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/commands/anime/char.js b/commands/anime/char.js index 68deb31..3cceb66 100644 --- a/commands/anime/char.js +++ b/commands/anime/char.js @@ -312,7 +312,7 @@ module.exports = { if (!tempchar) {return;} args = tempchar.split(/\s+/g); } - let asr = await chs(message, client, args.join(" ").trim().toLowerCase(), -700, 0); + let asr = await chs(message, client, args.join(" ").trim().toLowerCase(), -700); let fn; if (asr === 0) { return message.channel.send("That search returned no results! Try again?"); @@ -339,6 +339,7 @@ module.exports = { let ch = await Char.findOne({id: fn}); if (list) { + ch.images.push(ch.thumbnail); let pages = ch.images.map(im => new Discord.MessageEmbed() .setTitle(ch.name) .setDescription(`**Name:** ${ch.name}`) @@ -359,7 +360,7 @@ module.exports = { if (!args[0]) { let tempchar = message.attachments.size ? message.attachments.first().url - : await ask(message, "Please paste the image or a link to the image you'd like to add.", 60000, false, true); + : await ask(message, `Please paste the image or a link to the image you'd like to add to **${ch.name}**.`, 60000, false, true); if (!tempchar) {return;} args = tempchar.split(/\s+/g); } @@ -388,7 +389,7 @@ module.exports = { .setFooter("Natsuki") ], content: queue ? '<@330547934951112705>' : undefined }).catch(() => {})).catch(() => {}); - return message.channel.send(`Character image ${queue ? "submitted" : "added"}.`); + return message.channel.send(`Character image ${queue ? "submitted" : "added"} to **${ch.name}**.`); } else { if (!queue) { images.forEach(img => ch.images.push(img)); @@ -408,7 +409,7 @@ module.exports = { .setFooter("Natsuki") ], content: queue ? '<@330547934951112705>' : undefined }).catch(() => {})).catch(() => {}); - return message.channel.send(`Character images ${queue ? "submitted" : "added"}.`); + return message.channel.send(`Character images (${images.length}) ${queue ? "submitted" : "added"} to **${ch.name}**.`); } } } diff --git a/commands/anime/charimage.js b/commands/anime/charimage.js index b3783a5..4c7afe1 100644 --- a/commands/anime/charimage.js +++ b/commands/anime/charimage.js @@ -80,7 +80,7 @@ module.exports = { if (!args[0]) { let tempchar = message.attachments.size ? message.attachments.first().url - : await ask(message, "Please paste the image or a link to the image you'd like to add.", 60000, false, true); + : await ask(message, `Please paste the image or a link to the image you'd like to add to **${ch.name}**.`, 60000, false, true); if (!tempchar) {return;} args = tempchar.split(/\s+/g); } @@ -109,7 +109,7 @@ module.exports = { .setFooter("Natsuki") ], content: queue ? '<@330547934951112705>' : undefined }).catch(() => {})).catch(() => {}); - return message.channel.send(`Character image ${queue ? "submitted" : "added"}.`); + return message.channel.send(`Character image ${queue ? "submitted" : "added"} to **${ch.name}**.`); } else { if (!queue) { images.forEach(img => ch.images.push(img)); @@ -129,7 +129,7 @@ module.exports = { .setFooter("Natsuki") ], content: queue ? '<@330547934951112705>' : undefined }).catch(() => {})).catch(() => {}); - return message.channel.send(`Character images ${queue ? "submitted" : "added"}.`); + return message.channel.send(`Character images (${images.length}) ${queue ? "submitted" : "added"} to **${ch.name}**.`); } } }