Fix quick code smell.
This commit is contained in:
@@ -97,10 +97,9 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
|||||||
min_value=1,
|
min_value=1,
|
||||||
max_value=30,
|
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.",
|
description="Channel to post Group in. If left empty, defaults to current channel.",
|
||||||
required=False,
|
required=False,
|
||||||
channel_types=[nextcord.ChannelType.text],
|
|
||||||
default=None,
|
default=None,
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
@@ -119,11 +118,13 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
|||||||
"""
|
"""
|
||||||
# if no channel provided, use current channel.
|
# if no channel provided, use current channel.
|
||||||
if channel is None:
|
if channel is None:
|
||||||
channel = interaction.channel
|
channel_id: int = interaction.channel.id
|
||||||
|
else:
|
||||||
|
channel_id: int = channel.id
|
||||||
|
|
||||||
new_group = CategoryGroup(
|
new_group = CategoryGroup(
|
||||||
GroupName=group_name,
|
GroupName=group_name,
|
||||||
ChannelId=channel.id,
|
ChannelId=channel_id,
|
||||||
GuildId=interaction.guild_id,
|
GuildId=interaction.guild_id,
|
||||||
PadLength=pad_length,
|
PadLength=pad_length,
|
||||||
UsernameLength=username_length,
|
UsernameLength=username_length,
|
||||||
|
|||||||
Reference in New Issue
Block a user