# Path: channelredirect/converters.py
# class CogOrCOmmand(NamedTuple):
#     stype: str
#     obj: str
# 
#     @classmethod
#     async def convert(cls, ctx: commands.Context, arg: str):
#         # mypy doesn't do type narrowing for the walrus yet
#         if com := ctx.bot.get_command(arg):
#             assert com, "mypy"  # nosec
#             return cls("command", com.qualified_name)
#         if cog := ctx.bot.get_cog(arg):
#             assert cog, "mypy"  # nosec
#             return cls("cog", cog.__class__.__name__)
#         raise commands.BadArgument('Cog or Command "{arg}" not found.'.format(arg=arg))
# 
# class CommandConverter(NamedTuple):
#     com: commands.Command
# 
#     @classmethod
#     async def convert(cls, ctx: commands.Context, arg: str):
#         ret = ctx.bot.get_command(arg)
#         if ret:
#             return cls(ret)
#         raise commands.BadArgument('Command "{arg}" not found.'.format(arg=arg))
# 
# class TrinaryBool(NamedTuple):
#     state: Union[bool, None]
# 
#     @classmethod
#     async def convert(cls, ctx: commands.Context, arg: str):
#         try:
#             ret = {"allow": True, "deny": False, "clear": None}[arg.lower()]
#         except KeyError:
#             raise commands.BadArgument(
#                 "Was expecting one of `allow`, `deny`, or `clear`, got {arg}".format(
#                     arg=arg
#                 )
#             )
#         else:
#             return cls(ret)


import asyncio
import contextlib
import discord
from typing import Set
from redbot.core import checks, commands
from redbot.core.config import Config
from .converters import CogOrCOmmand, CommandConverter, TrinaryBool
        """
        await self.config.guild(ctx.guild).com_whitelist.set_raw(
            *cog_or_command, value=True
        )
        await ctx.tick()

    @rset_except.command(name="unallowcommandeverywhere")
    async def rset_whitelistcom_rem(
        self, ctx: commands.Context, *, cog_or_command: CogOrCOmmand
    ):
        """
        Removes an exception allowing a command in all channels.

        Note: This command name is not a typo as it is undoing

        [p]allowcommandeverywhere

        However, if you have a better name
        feel free to open an issue suggesting it
        """
        await self.config.guild(ctx.guild).com_whitelist.set_raw(
            *cog_or_command, value=False
        )
        await ctx.tick()

    @rset_except.command(name="add")
    async def rset_except_add(
        self,
        ctx: commands.Context,
        channel: discord.TextChannel,

# Path: channelredirect/converters.py
# class CogOrCOmmand(NamedTuple):
#     stype: str
#     obj: str
# 
#     @classmethod
#     async def convert(cls, ctx: commands.Context, arg: str):
#         # mypy doesn't do type narrowing for the walrus yet
#         if com := ctx.bot.get_command(arg):
#             assert com, "mypy"  # nosec
#             return cls("command", com.qualified_name)
#         if cog := ctx.bot.get_cog(arg):
#             assert cog, "mypy"  # nosec
#             return cls("cog", cog.__class__.__name__)
#         raise commands.BadArgument('Cog or Command "{arg}" not found.'.format(arg=arg))
# 
# class CommandConverter(NamedTuple):
#     com: commands.Command
# 
#     @classmethod
#     async def convert(cls, ctx: commands.Context, arg: str):
#         ret = ctx.bot.get_command(arg)
#         if ret:
#             return cls(ret)
#         raise commands.BadArgument('Command "{arg}" not found.'.format(arg=arg))
# 
# class TrinaryBool(NamedTuple):
#     state: Union[bool, None]
# 
#     @classmethod
#     async def convert(cls, ctx: commands.Context, arg: str):
#         try:
#             ret = {"allow": True, "deny": False, "clear": None}[arg.lower()]
#         except KeyError:
#             raise commands.BadArgument(
#                 "Was expecting one of `allow`, `deny`, or `clear`, got {arg}".format(
#                     arg=arg
#                 )
#             )
#         else:
#             return cls(ret)


# Path: channelredirect/redirect.py
import asyncio
import contextlib
import discord
from typing import Set
from redbot.core import checks, commands
from redbot.core.config import Config
from .converters import CogOrCOmmand, CommandConverter, TrinaryBool

        """
        await self.config.guild(ctx.guild).com_whitelist.set_raw(
            *cog_or_command, value=True
        )
        await ctx.tick()

    @rset_except.command(name="unallowcommandeverywhere")
    async def rset_whitelistcom_rem(
        self, ctx: commands.Context, *, cog_or_command: CogOrCOmmand
    ):
        """
        Removes an exception allowing a command in all channels.

        Note: This command name is not a typo as it is undoing

        [p]allowcommandeverywhere

        However, if you have a better name
        feel free to open an issue suggesting it
        """
        await self.config.guild(ctx.guild).com_whitelist.set_raw(
            *cog_or_command, value=False
        )
        await ctx.tick()

    @rset_except.command(name="add")
    async def rset_except_add(
        self,
        ctx: commands.Context,
        channel: discord.TextChannel,

        value: TrinaryBool,