1 Commits

Author SHA1 Message Date
JDJG Inc. Official
9e4c0f1065 Update object.py 2021-10-03 22:42:54 -04:00
4 changed files with 18 additions and 5 deletions

View File

@@ -41,9 +41,7 @@ Key Features
Installing
----------
**Python 3.8 or higher is required***
***Do not use 3.9.7 as Python 3.9.7 has a bug that causes a TypeError with __init__ methods in subclasses.** View more `here <https://bugs.python.org/issue45121/>`_.
**Python 3.8 or higher is required**
To install the library without full voice support, you can just run the following command:

View File

@@ -188,7 +188,7 @@ class HTTPClient:
self.proxy_auth: Optional[aiohttp.BasicAuth] = proxy_auth
self.use_clock: bool = not unsync_clock
user_agent = "DiscordBot (https://github.com/iDevision/enhanced-discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}"
user_agent = "DiscordBot (https://github.com/Rapptz/discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}"
self.user_agent: str = user_agent.format(__version__, sys.version_info, aiohttp.__version__)
def recreate(self) -> None:

View File

@@ -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)

View File

@@ -70,7 +70,7 @@ setup(
include_package_data=True,
install_requires=requirements,
extras_require=extras_require,
python_requires=">=3.8.0, !=3.9.7",
python_requires=">=3.8.0",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",