Browse Source

Re-add hits command by using .count()

pull/9/head
Abheek Dhawan 4 years ago
parent
commit
fe1212c82c
  1. 12
      bot/awesomescibo.js

12
bot/awesomescibo.js

@ -469,7 +469,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 });
let finalMessage = "";
if (!rounds) {
message.reply("you haven't requested any rounds!");
@ -493,6 +493,13 @@ async function userRounds(message) {
message.channel.send(roundsEmbed);
}
async function hits(message) {
let totalCount = await generatedRound.count({});
let userCount = await generatedRound.count({ requestedBy: message.author.id });
message.channel.send(`Total Hits: ${totalCount}\nYour Hits: ${userCount}`);
}
client.on("message", async (message) => {
if (message.author.bot) {
return;
@ -532,6 +539,9 @@ client.on("message", async (message) => {
case "dobemyrounds":
userRounds(message);
break;
case "dobehits":
hits(message);
break;
default:
// Do be training
otherCommands(message);

Loading…
Cancel
Save