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()
|
@keyword.command()
|
||||||
@guild_only()
|
@guild_only()
|
||||||
async def pause(self, ctx):
|
async def pause(self, ctx):
|
||||||
pass
|
params = (ctx.author.id, ctx.guild_id)
|
||||||
# TODO: Pause guild notifications
|
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)
|
@keyword.group(invoke_without_command=True)
|
||||||
@guild_only()
|
@guild_only()
|
||||||
|
|
Loading…
Reference in a new issue