From 35ad7a77a74bd443e4c48c7b11a9f86fbd08ca74 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 13 Feb 2024 23:19:41 +0000 Subject: [PATCH] fix(aurora): require ids to be ints in some utlis functions --- aurora/utilities/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aurora/utilities/utils.py b/aurora/utilities/utils.py index fa11217..af5dec1 100644 --- a/aurora/utilities/utils.py +++ b/aurora/utilities/utils.py @@ -146,7 +146,7 @@ def generate_dict(result) -> dict: return case -async def fetch_user_dict(client: commands.Bot, user_id: str) -> dict: +async def fetch_user_dict(client: commands.Bot, user_id: int) -> dict: """This function returns a dictionary containing either user information or a standard deleted user template.""" if user_id == "?": user_dict = {"id": "?", "name": "Unknown User", "discriminator": "0"} @@ -173,10 +173,10 @@ async def fetch_user_dict(client: commands.Bot, user_id: str) -> dict: return user_dict -async def fetch_channel_dict(guild: Guild, channel_id: str) -> dict: +async def fetch_channel_dict(guild: Guild, channel_id: int) -> dict: """This function returns a dictionary containing either channel information or a standard deleted channel template.""" try: - channel = guild.get_channel(channel_id) + channel = guild.get_channel(int(channel_id)) if not channel: channel = await guild.fetch_channel(channel_id) @@ -192,9 +192,9 @@ async def fetch_channel_dict(guild: Guild, channel_id: str) -> dict: return channel_dict -async def fetch_role_dict(guild: Guild, role_id: str) -> dict: +async def fetch_role_dict(guild: Guild, role_id: int) -> dict: """This function returns a dictionary containing either role information or a standard deleted role template.""" - role = guild.get_role(role_id) + role = guild.get_role(int(role_id)) if not role: role_dict = {"id": role_id, "name": "Deleted Role"}