From 3c4d1674accc023d0d9822b290e51bee677d1ebc Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 2 May 2021 11:53:34 -0500 Subject: [PATCH] Add time stamp and author tag to generated rounds collection --- bot/awesomescibo.js | 2 ++ bot/mongooseModels/mongooseGeneratedRoundModel.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index 5f30412..bd0a3af 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -337,6 +337,8 @@ async function generateRound(message) { newGeneratedRound = new generatedRound({ htmlContent: finalizedHTML, requestedBy: message.author.id, + authorTag: message.author.tag, + timestamp: new Date().toISOString(), }); newGeneratedRound.save((err, round) => { if (err) { diff --git a/bot/mongooseModels/mongooseGeneratedRoundModel.js b/bot/mongooseModels/mongooseGeneratedRoundModel.js index b0e9515..164219b 100644 --- a/bot/mongooseModels/mongooseGeneratedRoundModel.js +++ b/bot/mongooseModels/mongooseGeneratedRoundModel.js @@ -9,6 +9,14 @@ const generatedRoundSchema = new mongoose.Schema({ type: String, required: true, }, + authorTag: { + type: String, + required: true, + }, + timestamp: { + type: String, + required: true, + } }); module.exports = mongoose.model("GeneratedRounds", generatedRoundSchema);