From 8870d93a44a10ff5cca7c09191ae3c08636cb022 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 26 Feb 2025 20:42:44 -0500 Subject: [PATCH] Fix quick code smell. --- cogs/commands/create.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cogs/commands/create.py b/cogs/commands/create.py index b07aee0..3b0208c 100644 --- a/cogs/commands/create.py +++ b/cogs/commands/create.py @@ -97,10 +97,9 @@ class CreateCog(commands.Cog, name="Create Cog"): min_value=1, max_value=30, ), - channel: nextcord.abc.GuildChannel | None = nextcord.SlashOption( + channel: nextcord.TextChannel | None = nextcord.SlashOption( description="Channel to post Group in. If left empty, defaults to current channel.", required=False, - channel_types=[nextcord.ChannelType.text], default=None, ), ) -> None: @@ -119,11 +118,13 @@ class CreateCog(commands.Cog, name="Create Cog"): """ # if no channel provided, use current channel. if channel is None: - channel = interaction.channel + channel_id: int = interaction.channel.id + else: + channel_id: int = channel.id new_group = CategoryGroup( GroupName=group_name, - ChannelId=channel.id, + ChannelId=channel_id, GuildId=interaction.guild_id, PadLength=pad_length, UsernameLength=username_length,