forked from cswimr/SeaCogs
fix(aurora): require ids to be ints in some utlis functions
This commit is contained in:
parent
f7d2f1a564
commit
35ad7a77a7
1 changed files with 5 additions and 5 deletions
|
@ -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"}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue