Browse Source

Testing requesting previous rounds generated

pull/9/head
Abheek Dhawan 4 years ago
parent
commit
0221049bbe
  1. 21
      bot/awesomescibo.js

21
bot/awesomescibo.js

@ -471,6 +471,25 @@ function aboutMessage(message) {
); );
} }
async function userRounds(message) {
let rounds = await generatedRound.find({ requestedBy: message.author.id});
let finalMessage = "";
if (!rounds) {
message.reply("you haven't requested any rounds!");
return;
}
if (rounds.length > 5) {
let rounds = rounds.slice(0, 5);
}
rounds.forEach(async (item, index) => {
finalMessage += `[${index}. ${item.split("T")[0]}](https://api.adawesome.tech/round/${item._id.toString()})\n`;
});
message.channel.send(finalMessage);
}
client.on("message", async (message) => { client.on("message", async (message) => {
if (message.author.bot) { if (message.author.bot) {
return; return;
@ -507,6 +526,8 @@ client.on("message", async (message) => {
case "dobeabout": // Show about message of bot case "dobeabout": // Show about message of bot
aboutMessage(message); aboutMessage(message);
break; break;
case "dobemyrounds":
usersRounds(message);
default: default:
// Do be training // Do be training
otherCommands(message); otherCommands(message);

Loading…
Cancel
Save