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

Loading…
Cancel
Save