implement purge command
This commit is contained in:
parent
981e113af8
commit
35b43332e4
1 changed files with 22 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue