fix(aurora): require ids to be ints in some utlis functions
All checks were successful
Actions / Lint Code (Pylint) (push) Successful in 51s
Actions / Build Documentation (MkDocs) (push) Successful in 14s

This commit is contained in:
Seaswimmer 2024-02-13 23:19:41 +00:00
parent f7d2f1a564
commit 35ad7a77a7
Signed by: cswimr
GPG key ID: AB39CBC5A4135AB8

View file

@ -146,7 +146,7 @@ def generate_dict(result) -> dict:
return case 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.""" """This function returns a dictionary containing either user information or a standard deleted user template."""
if user_id == "?": if user_id == "?":
user_dict = {"id": "?", "name": "Unknown User", "discriminator": "0"} 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 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.""" """This function returns a dictionary containing either channel information or a standard deleted channel template."""
try: try:
channel = guild.get_channel(channel_id) channel = guild.get_channel(int(channel_id))
if not channel: if not channel:
channel = await guild.fetch_channel(channel_id) 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 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.""" """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: if not role:
role_dict = {"id": role_id, "name": "Deleted Role"} role_dict = {"id": role_id, "name": "Deleted Role"}