|
|
@@ -205,6 +205,20 @@ class Admin(): |
|
|
|
except KeyError: |
|
|
|
return await ctx.send("Could not find user in warning list.") |
|
|
|
|
|
|
|
@commands.bot_has_permissions(ban_members=True) |
|
|
|
@warn.command() |
|
|
|
async def purge(self, ctx, dry_run=0): |
|
|
|
"""Purges banned users from the warn list. Add a 1 at the end to do a dry run.""" |
|
|
|
settings = gs.get(ctx.guild) |
|
|
|
count = 0 |
|
|
|
for ban in await ctx.guild.bans(): |
|
|
|
for user in settings.warnings: |
|
|
|
if user == ban.user.id: |
|
|
|
if not dry_run: |
|
|
|
settings.warnings.pop(user) |
|
|
|
count += 1 |
|
|
|
return await ctx.send("Purged {} banned users from the warn list.".format(count)) |
|
|
|
|
|
|
|
@commands.has_permissions(kick_members=True) |
|
|
|
@commands.bot_has_permissions(kick_members=True) |
|
|
|
@bot.command() |