From 2315afd7fb94e5310f6b61f57d7d6fc42af48efe Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 28 Jan 2022 13:22:06 -0700 Subject: [PATCH] chars added to ani when accepted --- commands/anime/char.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/anime/char.js b/commands/anime/char.js index ef411e1..f7d6c48 100644 --- a/commands/anime/char.js +++ b/commands/anime/char.js @@ -398,6 +398,15 @@ module.exports = { .setFooter({text: "Natsuki"}) .setTimestamp() ]}).catch(() => {}); + let ani = await AniData.findOne({id: tr.anime}); + if (!ani) { + tr.queued = false; + tr.save(); + return message.channel.send("I can't accept that submission for you because it doesn't have a valid anime listed. Please report this to a dev."); + } + ani.characters.push(tr.id); + ani.markModified('characters'); + ani.save(); return message.channel.send("I've accepted that submission."); }) .catch(() => {return message.reply("It seems that submission wasn't accepted for some reason. \*insert head scratching*");});