Browse Source

Add time stamp and author tag to generated rounds collection

pull/9/head
Abheek Dhawan 4 years ago
parent
commit
3c4d1674ac
  1. 2
      bot/awesomescibo.js
  2. 8
      bot/mongooseModels/mongooseGeneratedRoundModel.js

2
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) {

8
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);

Loading…
Cancel
Save