Clarify optional SlashOptions

This commit is contained in:
alwayscompiling
2022-12-02 15:28:53 -05:00
parent 2e3f298036
commit 14602282e9
2 changed files with 12 additions and 16 deletions
+9 -13
View File
@@ -33,9 +33,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
async def group_output_channel(
self,
interaction: nextcord.Interaction,
group_id: Optional[int] = nextcord.SlashOption(
description="Category Group to assign to channel.", required=True
),
group_id: int = nextcord.SlashOption(description="Category Group to assign to channel.", required=True),
channel: Optional[nextcord.abc.GuildChannel] = nextcord.SlashOption(
description="Channel to register",
required=False,
@@ -48,7 +46,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
Args:
interaction (nextcord.Interaction): Interaction that invoked the command
group_id (Optional[int]): Group to register channel to. Is SlashOption.
group_id (int): Group to register channel to. Is SlashOption.
channel (nextcord.abc.GuildChannel, optional): Channel to register
Is a SlashOption. Limited to text channels, Defaults to None.
"""
@@ -109,7 +107,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
Args:
interaction (nextcord.Interaction): Interaction that invoked the command
channel (Optional[nextcord.abc.GuildChannel], optional): Channel to register
channel (Optional[nextcord.abc.GuildChannel]): Channel to register
Is a SlashOption. Limited to text channels, Defaults to None.
"""
if not channel:
@@ -133,18 +131,16 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
async def category_pad_length(
self,
interaction: nextcord.Interaction,
group_id: Optional[int] = nextcord.SlashOption(
description="Category Group to assign to channel.", required=True
),
length: Optional[int] = nextcord.SlashOption(description="Number of characters.", required=True, default=26),
group_id: int = nextcord.SlashOption(description="Category Group to assign to channel.", required=True),
length: int = nextcord.SlashOption(description="Number of characters.", required=True, default=26),
) -> None:
"""
Changes guild's category pad length.
Args:
interaction (nextcord.Interaction): Interaction that invoked the command
group_id (Optional[int]): Group to set pad length in. Is SlashOption.
length (Optional[int]): Number of characters. Is SlashOption. Defaults to 26.
group_id (int): Group to set pad length in. Is SlashOption.
length (int): Number of characters. Is SlashOption. Defaults to 26.
"""
stmt = (
@@ -175,14 +171,14 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
async def username_length(
self,
interaction: nextcord.Interaction,
length: Optional[int] = nextcord.SlashOption(description="Number of characters.", required=True, default=12),
length: int = nextcord.SlashOption(description="Number of characters.", required=True, default=12),
) -> None:
"""
Changes guild's username length limit.
Args:
interaction (nextcord.Interaction): Interaction that invoked the command
length (Optional[int]): Number of charactesr. Is SlashOption. Defaults to 12.
length (int): Number of charactesr. Is SlashOption. Defaults to 12.
"""
stmt = select(Guild).where(Guild.GuildId == interaction.guild_id)