Skip to content

Commit b86ae9f

Browse files
committed
updated object to have more values.
1 parent b897a08 commit b86ae9f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

discord/object.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,18 @@ def __repr__(self) -> str:
9191
def created_at(self) -> datetime.datetime:
9292
""":class:`datetime.datetime`: Returns the snowflake's creation time in UTC."""
9393
return utils.snowflake_time(self.id)
94+
95+
@property
96+
def worker_id(self) -> int:
97+
""":class:`int`: Returns the worker id that made the snowflake."""
98+
return (self.id & 0x3E0000) >> 17
99+
100+
@property
101+
def process_id(self) -> int:
102+
""":class:`int`: Returns the process id that made the snowflake."""
103+
return (self.id & 0x1F000) >> 12
104+
105+
@property
106+
def increment_id(self) -> int:
107+
""":class:`int`: Returns the increment id that made the snowflake."""
108+
return (self.id & 0xFFF)

0 commit comments

Comments
 (0)