diff --git a/nomen/notifications.py b/nomen/notifications.py index 9bb9f8e..32ecc12 100644 --- a/nomen/notifications.py +++ b/nomen/notifications.py @@ -1,8 +1,9 @@ import logging from asyncio import TaskGroup from textwrap import indent +from typing import Union -from disnake import Embed +from disnake import Embed, Member, TextChannel from disnake.ext.commands import Cog, group, guild_only from .utils import can_view, confirm, fetch_exists, fetch_unpacked, test_keyword @@ -307,12 +308,21 @@ class Notifications(Cog): @keyword.group(invoke_without_command=True) @guild_only() - async def ignore(self, ctx, channel): + async def ignore(self, ctx, target: Union[TextChannel, Member]): + await ctx.bot.db.execute("INSERT INTO user_ignores VALUES(?, ?, ?)", (ctx.author.id, ctx.guild.id, target.id)) + await ctx.bot.db.commit() + await ctx.send(f"Now ignoring {target}") + + @keyword.command() + @guild_only() + async def uningnore(self, ctx, target: Union[TextChannel, Member]): pass - # TODO: Ignore channels and users + # TODO: Unignore @ignore.command() @guild_only() async def active(self, ctx): - pass - # TODO: Ignore active channel + await ctx.bot.user_toggle(ctx.author.id, "ignore_active") + await ctx.bot.send("Toggled ignore active channel") # TODO: Send current state + + # TODO: Ignore active channel in handler