Implement .activecount
Satisfies
@@ -78,6 +78,24 @@ class Extras:
count = await self.bot.estimate_pruned_members(server=self.bot.server, days=days)
await self.bot.edit_message(msg, "{:,} members inactive for {} day(s) would be kicked from {}!".format(count, days, self.bot.server.name))
+ @commands.has_permissions(manage_nicknames=True)
+ @commands.command()
+ async def activecount(self, days=30):
+ """Shows the number of members active in the past amount of days. Staff only."""
+ if days > 30:
+ await self.bot.say("Maximum 30 days")
+ return
+ if days < 1:
+ await self.bot.say("Minimum 1 day")
+ return
+ msg = await self.bot.say("I'm figuring this out!".format(self.bot.server.name))
+ count = await self.bot.estimate_pruned_members(server=self.bot.server, days=days)
+ if days = 1:
+ await self.bot.edit_message(msg, "{:,} members were active today in {}!".format(self.bot.server.member_count-count, self.bot.server.name))
+ else:
+ await self.bot.edit_message(msg, "{:,} members were active in the past {} days in {}!".format(self.bot.server.member_count-count, days, self.bot.server.name))
+
+
@commands.has_permissions(manage_nicknames=True)
@commands.command(pass_context=True)
async def prune30(self, ctx, key=""):
