From 9e4c0f10657270401d1136c93c5db9309d714b62 Mon Sep 17 00:00:00 2001 From: "JDJG Inc. Official" Date: Sun, 3 Oct 2021 22:42:54 -0400 Subject: [PATCH] Update object.py --- discord/object.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/discord/object.py b/discord/object.py index b63242d9..25b9cb88 100644 --- a/discord/object.py +++ b/discord/object.py @@ -94,3 +94,18 @@ class Object(Hashable): def created_at(self) -> datetime.datetime: """:class:`datetime.datetime`: Returns the snowflake's creation time in UTC.""" return utils.snowflake_time(self.id) + + @property + def worker_id(self) -> int: + """:class:`int`: Returns the worker id that made the snowflake.""" + return (self.id & 0x3E0000) >> 17 + + @property + def process_id(self) -> int: + """:class:`int`: Returns the process id that made the snowflake.""" + return (self.id & 0x1F000) >> 12 + + @property + def increment_id(self) -> int: + """:class:`int`: Returns the increment id that made the snowflake.""" + return (self.id & 0xFFF) -- 2.47.2