Skip to content

Commit

Permalink
Revert "Added increment, process and worker ids to utils.py. Also add…
Browse files Browse the repository at this point in the history
…ed to __all__"

This reverts commit 268833c.
  • Loading branch information
dolfies authored Jan 12, 2025
1 parent 1ba85da commit 9a410cf
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions discord/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@
__all__ = (
'oauth_url',
'snowflake_time',
'snowflake_worker_id',
'snowflake_process_id',
'snowflake_increment',
'time_snowflake',
'find',
'get',
Expand Down Expand Up @@ -443,49 +440,6 @@ def oauth_url(
url += f'&{urlencode({"state": state})}'
return url

def snowflake_worker_id(id: int, /) -> int:
"""Returns the worker id of the given snowflake
Paramaters
-----------
id: :class:`int`
The snowflake ID.
Returns
--------
:class:`int`
The worker ID used to generate the snowflake.
"""
return (id >> 17) & 0x1F

def snowflake_process_id(id: int, /) -> int:
"""Returns the process id of the given snowflake
Paramaters
-----------
id: :class:`int`
The snowflake ID.
Returns
--------
:class:`int`
The process ID used to generate the snowflake.
"""
return (id >> 12) & 0x1F

def snowflake_increment(id: int, /) -> int:
"""Returns the increment of the given snowflake.
For every generated ID on that process, this number is incremented.
Paramaters
-----------
id: :class:`int`
The snowflake ID.
Returns
--------
:class:`int`
The increment of current snowflake.
"""
return id & 0xFFF


def snowflake_time(id: int, /) -> datetime.datetime:
"""Returns the creation time of the given snowflake.
Expand Down

0 comments on commit 9a410cf

Please sign in to comment.