diff --git a/jarvis/cogs/admin/purge.py b/jarvis/cogs/admin/purge.py index e7ab329..4be51f1 100644 --- a/jarvis/cogs/admin/purge.py +++ b/jarvis/cogs/admin/purge.py @@ -1,6 +1,6 @@ """J.A.R.V.I.S. PurgeCog.""" from dis_snek import InteractionContext, Permissions, Scale, Snek -from dis_snek.models.discord.channel import TextChannel +from dis_snek.models.discord.channel import GuildText from dis_snek.models.snek.application_commands import ( OptionTypes, slash_command, @@ -59,10 +59,10 @@ class PurgeCog(Scale): ) @admin_or_permissions(Permissions.MANAGE_MESSAGES) async def _autopurge_add( - self, ctx: InteractionContext, channel: TextChannel, delay: int = 30 + self, ctx: InteractionContext, channel: GuildText, delay: int = 30 ) -> None: - if not isinstance(channel, TextChannel): - await ctx.send("Channel must be a TextChannel", hidden=True) + if not isinstance(channel, GuildText): + await ctx.send("Channel must be a GuildText channel", hidden=True) return if delay <= 0: await ctx.send("Delay must be > 0", hidden=True) @@ -92,7 +92,7 @@ class PurgeCog(Scale): required=True, ) @admin_or_permissions(Permissions.MANAGE_MESSAGES) - async def _autopurge_remove(self, ctx: InteractionContext, channel: TextChannel) -> None: + async def _autopurge_remove(self, ctx: InteractionContext, channel: GuildText) -> None: autopurge = Autopurge.objects(guild=ctx.guild.id, channel=channel.id) if not autopurge: await ctx.send("Autopurge does not exist.", hidden=True) @@ -119,7 +119,7 @@ class PurgeCog(Scale): ) @admin_or_permissions(Permissions.MANAGE_MESSAGES) async def _autopurge_update( - self, ctx: InteractionContext, channel: TextChannel, delay: int + self, ctx: InteractionContext, channel: GuildText, delay: int ) -> None: autopurge = Autopurge.objects(guild=ctx.guild.id, channel=channel.id) if not autopurge: