From 636b3a0b1ed40ebdbf1b6bae659290737da089b1 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 14 May 2021 11:32:44 -0500 Subject: [PATCH] Attempt to sort user rounds by most recent --- bot/awesomescibo.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index b300619..0716e52 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -398,7 +398,7 @@ function aboutMessage(message) { } async function userRounds(message) { - let rounds = await generatedRound.find({ requestedBy: message.author.id }); + let rounds = await generatedRound.find({ requestedBy: message.author.id }).sort({ timestamp: -1 }); let finalMessage = ""; if (!rounds) { message.reply("you haven't requested any rounds!"); @@ -445,10 +445,7 @@ client.on("message", async (message) => { sendHelpMessage(message); break; case "doberoundgen": // Generate round publicly - generateRound(message, false); - break; - case "doberoundgendm": // Generate round through DM - generateRound(message, true); + generateRound(message); break; case "dobescoring": // Start scoring startScoring(message);