implement pause toggle
This commit is contained in:
parent
e9eb68285e
commit
49a7ac9fd7
1 changed files with 8 additions and 2 deletions
|
@ -303,8 +303,14 @@ class Notifications(Cog):
|
|||
@keyword.command()
|
||||
@guild_only()
|
||||
async def pause(self, ctx):
|
||||
pass
|
||||
# TODO: Pause guild notifications
|
||||
params = (ctx.author.id, ctx.guild_id)
|
||||
if await fetch_exists("SELECT * FROM user_pauses WHERE user_id=? AND guild_id=?"):
|
||||
await ctx.bot.db.execute("DELETE FROM user_pauses WHERE user_id=? AND guild_id=?", params)
|
||||
await ctx.bot.send(f"Resumed notifications in {ctx.guild}")
|
||||
else:
|
||||
await ctx.bot.db.execute("INSERT INTO user_pauses VALUES(?, ?)", params)
|
||||
await ctx.bot.send(f"Paused notifications in {ctx.guild}")
|
||||
# TODO: Pause guild notifications in handler
|
||||
|
||||
@keyword.group(invoke_without_command=True)
|
||||
@guild_only()
|
||||
|
|
Loading…
Reference in a new issue