Corrected autofill function return structures.

This commit is contained in:
alwayscompiling
2022-12-02 16:32:22 -05:00
parent 14602282e9
commit 4e832a084f
4 changed files with 35 additions and 30 deletions
+6 -6
View File
@@ -33,7 +33,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
async def group_output_channel(
self,
interaction: nextcord.Interaction,
group_id: int = nextcord.SlashOption(description="Category Group to assign to channel.", required=True),
group_id: str = nextcord.SlashOption(description="Category Group to assign to channel.", required=True),
channel: Optional[nextcord.abc.GuildChannel] = nextcord.SlashOption(
description="Channel to register",
required=False,
@@ -46,7 +46,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
Args:
interaction (nextcord.Interaction): Interaction that invoked the command
group_id (int): Group to register channel to. Is SlashOption.
group_id (str): String representation of Group id to register channel to. Is SlashOption.
channel (nextcord.abc.GuildChannel, optional): Channel to register
Is a SlashOption. Limited to text channels, Defaults to None.
"""
@@ -56,7 +56,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
stmt = (
select(CategoryGroup)
.where(CategoryGroup.GuildId == interaction.guild_id)
.where(CategoryGroup.GroupId == group_id)
.where(CategoryGroup.GroupId == int(group_id))
)
group = session.scalar(stmt)
group.ChannelId = channel_id
@@ -131,7 +131,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
async def category_pad_length(
self,
interaction: nextcord.Interaction,
group_id: int = nextcord.SlashOption(description="Category Group to assign to channel.", required=True),
group_id: str = nextcord.SlashOption(description="Category Group to assign pad length to.", required=True),
length: int = nextcord.SlashOption(description="Number of characters.", required=True, default=26),
) -> None:
"""
@@ -139,14 +139,14 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
Args:
interaction (nextcord.Interaction): Interaction that invoked the command
group_id (int): Group to set pad length in. Is SlashOption.
group_id (str): String representation of Group id to set pad length in. Is SlashOption.
length (int): Number of characters. Is SlashOption. Defaults to 26.
"""
stmt = (
select(CategoryGroup)
.where(CategoryGroup.GuildId == interaction.guild_id)
.where(CategoryGroup.GroupId == group_id)
.where(CategoryGroup.GroupId == int(group_id))
)
group = session.scalar(stmt)
group.PadLength = length