diff --git a/nomen/settings.py b/nomen/settings.py index 137ccba..814da3e 100644 --- a/nomen/settings.py +++ b/nomen/settings.py @@ -25,7 +25,28 @@ class Settings(Cog): """ Deletes all user data stored in Nomen """ - pass + + msg = f"""\ +Are you sure you wish to delete **ALL** data across **ALL** servers? (y/N) +NOTE: If you have currently opted-out, this will opt you back in. + +You may want to `{ctx.clean_prefix}nomen export` first""" + + to_purge = await confirm(ctx, msg) + + if to_purge: + await self.bot.db.execute( + """ + DELETE FROM keywords WHERE user_id=?; + DELETE FROM users WHERE user_id=?; + DELETE FROM user_ignores WHERE user_id=?; + """, + (ctx.author.id,), + ) + await self.bot.db.commit() + await ctx.send("Deleted all user data.") + else: + await ctx.send("Cancelled.") @nomen.command(name="import") @guild_only()