Adds the Dt function thing

Again on mobile
This commit is contained in:
JDJG Inc. Official 2021-10-04 14:04:41 -04:00 committed by GitHub
parent 6a9083a504
commit d2837a34f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,6 @@ __all__ = (
"as_chunks",
"format_dt",
"generate_snowflake",
"quick_snowflake"
)
DISCORD_EPOCH = 1420070400000
@ -1047,7 +1046,7 @@ def generate_snowflake(dt: Optional[datetime.datetime] = None) -> int:
:class:`int`
The snowflake representing the time given.
"""
dt = dt or utcnow()
return int(dt.timestamp() * 1000 - DISCORD_EPOCH) << 22 | 0x3fffff