add clearrconpasswords config command
@@ -186,6 +186,18 @@ class Config(commands.Cog):
else:
await self.bot.send(ctx, ctx.l.config.invalid.format('`on`, `off`'))
+ @config.command(name='clearrconpasswords', aliases=['clearpasswords', 'deletepasswords', 'delrconpasswords'])
+ @commands.cooldown(1, 10, commands.BucketType.user)
+ async def config_clear_rcon_passwords(self, ctx):
+ deleted = await self.db.mass_delete_user_rcon(ctx.author.id)
+
+ if len(deleted) < 1:
+ await self.bot.send(ctx, 'You didn\'t have any saved passwords')
+ elif len(deleted) == 1:
+ await self.bot.send(ctx, 'Removed 1 password from the database')
+ else:
+ await self.bot.send(ctx, f'Removed {len(deleted)} passwords from the database')
+
def setup(bot):
bot.add_cog(Config(bot))
