add limits to estprune
@@ -24,15 +24,21 @@ class Extras:
@commands.command()
async def membercount(self):
"""Prints the member count of the server."""
- await self.bot.say("{} has {} members!".format(self.bot.server.name, self.bot.server.member_count))
+ await self.bot.say("{} has {:,} members!".format(self.bot.server.name, self.bot.server.member_count))
@commands.has_permissions(manage_nicknames=True)
@commands.command()
async def estprune(self, days=30):
"""Estimate count of members that would be pruned based on the amount of days. Staff only."""
- msg = await self.bot.say("Estimating!".format(self.bot.server.name))
+ 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)
- await self.bot.edit_message(msg, "{} members inactive for {} would be kicked from {}!".format(count, days, self.bot.server.name))
+ 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(administrator=True)
@commands.command(pass_context=True, hidden=True)
