implement pause toggle

This commit is contained in:
Infinidoge 2024-12-28 04:05:26 -05:00
parent e9eb68285e
commit 49a7ac9fd7
Signed by: Infinidoge
SSH key fingerprint: SHA256:GT2StvPQMMfFHyiiFJymQxfTG/z6EWLJ6NWItf5K5sA

View file

@ -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()