From f9d765ad92763db599349ace736e29beb6013896 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Fri, 7 Mar 2025 16:09:33 -0500 Subject: [PATCH] Forgot to convert some ids to int. --- cogs/commands/set.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cogs/commands/set.py b/cogs/commands/set.py index 684f951..9aa84a1 100644 --- a/cogs/commands/set.py +++ b/cogs/commands/set.py @@ -45,7 +45,9 @@ class SetCog(commands.Cog, name="Set command."): category_id (str): String representation of Category id to register channel to. Is SlashOption. size (int): Size to set. Is SlashOption. """ - stmt = select(Category).where(col(CategoryGroup.id) == group_id).where(col(Category.id) == int(category_id)) + stmt = ( + select(Category).where(col(CategoryGroup.id) == int(group_id)).where(col(Category.id) == int(category_id)) + ) with Session(engine) as session: category = session.scalar(stmt) @@ -91,7 +93,9 @@ class SetCog(commands.Cog, name="Set command."): category_id (str): String representation of Category id to register channel to. Is SlashOption. ascending (bool): Boolean to set. Determines whether scores are sorted ascending or not. Is SlashOption. """ - stmt = select(Category).where(col(CategoryGroup.id) == group_id).where(col(Category.id) == int(category_id)) + stmt = ( + select(Category).where(col(CategoryGroup.id) == int(group_id)).where(col(Category.id) == int(category_id)) + ) with Session(engine) as session: category = session.scalar(stmt) @@ -139,7 +143,9 @@ class SetCog(commands.Cog, name="Set command."): category_id (str): String representation of Category id to register channel to. Is SlashOption. validated (bool): Boolean to set. Determines whether scores are validated or not. Is SlashOption. """ - stmt = select(Category).where(col(CategoryGroup.id) == group_id).where(col(Category.id) == int(category_id)) + stmt = ( + select(Category).where(col(CategoryGroup.id) == int(group_id)).where(col(Category.id) == int(category_id)) + ) with Session(engine) as session: category = session.scalar(stmt) @@ -184,7 +190,9 @@ class SetCog(commands.Cog, name="Set command."): category_id (str): String representation of Category id to register channel to. Is SlashOption. name (str): The name to update the category's name to. Is SlashOption. """ - stmt = select(Category).where(col(CategoryGroup.id) == group_id).where(col(Category.id) == int(category_id)) + stmt = ( + select(Category).where(col(CategoryGroup.id) == int(group_id)).where(col(Category.id) == int(category_id)) + ) with Session(engine) as session: category = session.scalar(stmt) @@ -229,7 +237,7 @@ class SetCog(commands.Cog, name="Set command."): group_id (str): String representation of Group id to register channel to. Is SlashOption. name (str): The name to update the group's name to. Is SlashOption. """ - stmt = select(CategoryGroup).where(col(CategoryGroup.id) == group_id) + stmt = select(CategoryGroup).where(col(CategoryGroup.id) == int(group_id)) with Session(engine) as session: group = session.scalar(stmt)