refactor: parse_snowflake -> snowflake_timestamp

This commit is contained in:
Ryan 2025-01-10 23:48:45 -05:00
parent 7fdaf7b379
commit de5d4d2793
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3
3 changed files with 5 additions and 5 deletions

View File

@ -67,7 +67,7 @@ async def lookup(message):
)
embed.add_field(
name="Creation Time",
value=f"<t:{utils.parse_snowflake(int(response['id']))}:R>",
value=f"<t:{utils.snowflake_timestamp(int(response['id']))}:R>",
)
embed.add_field(
name="Default Invite URL",
@ -135,7 +135,7 @@ async def lookup(message):
)
embed.add_field(
name="Creation Time",
value=f"<t:{utils.parse_snowflake(int(user.id))}:R>",
value=f"<t:{utils.snowflake_timestamp(int(user.id))}:R>",
)
embed.add_field(
name="Public Flags",

View File

@ -7,8 +7,8 @@ from .discord import (
cooldown,
invalid_user_handler,
load_opus,
parse_snowflake,
reply,
snowflake_timestamp,
)
__all__ = [
@ -22,6 +22,6 @@ __all__ = [
"LimitedSizeDict",
"load_opus",
"MessageInteractionWrapper",
"parse_snowflake",
"reply",
"snowflake_timestamp",
]

View File

@ -58,7 +58,7 @@ def load_opus():
raise Exception("could not locate working opus library")
def parse_snowflake(id):
def snowflake_timestamp(id):
return round(((id >> 22) + 1420070400000) / 1000)