Compare commits
3 Commits
JDJGInc/2.
...
kuanhulio/
Author | SHA1 | Date | |
---|---|---|---|
e48493b36c | |||
4931100b44 | |||
ec1e2add21 |
@ -41,7 +41,9 @@ Key Features
|
||||
Installing
|
||||
----------
|
||||
|
||||
**Python 3.8 or higher is required**
|
||||
**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/>`_.
|
||||
|
||||
To install the library without full voice support, you can just run the following command:
|
||||
|
||||
|
@ -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/Rapptz/discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}"
|
||||
user_agent = "DiscordBot (https://github.com/iDevision/enhanced-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:
|
||||
|
@ -84,7 +84,6 @@ __all__ = (
|
||||
"escape_mentions",
|
||||
"as_chunks",
|
||||
"format_dt",
|
||||
"generate_snowflake",
|
||||
)
|
||||
|
||||
DISCORD_EPOCH = 1420070400000
|
||||
@ -1021,23 +1020,3 @@ def format_dt(dt: datetime.datetime, /, style: Optional[TimestampStyle] = None)
|
||||
if style is None:
|
||||
return f"<t:{int(dt.timestamp())}>"
|
||||
return f"<t:{int(dt.timestamp())}:{style}>"
|
||||
|
||||
|
||||
def generate_snowflake(dt: Optional[datetime.datetime] = None) -> int:
|
||||
"""Returns a numeric snowflake pretending to be created at the given date but more accurate and random than time_snowflake.
|
||||
If No dt is not passed, it makes one from the current time using utcnow.
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
dt: :class:`datetime.datetime`
|
||||
A datetime object to convert to a snowflake.
|
||||
If naive, the timezone is assumed to be local time.
|
||||
|
||||
Returns
|
||||
--------
|
||||
:class:`int`
|
||||
The snowflake representing the time given.
|
||||
"""
|
||||
|
||||
dt = dt or utcnow()
|
||||
return int(dt.timestamp() * 1000 - DISCORD_EPOCH) << 22 | 0x3fffff
|
@ -1136,8 +1136,6 @@ Utility Functions
|
||||
|
||||
.. autofunction:: discord.utils.as_chunks
|
||||
|
||||
.. autofunction:: discord.utils.generate_snowflake
|
||||
|
||||
.. _discord-api-enums:
|
||||
|
||||
Enumerations
|
||||
|
Reference in New Issue
Block a user