aboutsummaryrefslogtreecommitdiff
path: root/discord/abc.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-04 23:54:08 -0400
committerRapptz <[email protected]>2021-04-04 23:54:08 -0400
commitff7094ce9602bad0b4408761841fa02bdb908987 (patch)
treed0d37067183f6827398181e598133146f870fa26 /discord/abc.py
parentRemove some lingering userbot classes in the documentation (diff)
downloaddiscord.py-ff7094ce9602bad0b4408761841fa02bdb908987.tar.xz
discord.py-ff7094ce9602bad0b4408761841fa02bdb908987.zip
Convert datetimes to aware datetimes with UTC.
Naive datetimes will now be interpreted as local time throughout the library.
Diffstat (limited to 'discord/abc.py')
-rw-r--r--discord/abc.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/discord/abc.py b/discord/abc.py
index 4930ae31..0130aa70 100644
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -75,7 +75,7 @@ class Snowflake(Protocol):
@property
def created_at(self) -> datetime:
- """:class:`datetime.datetime`: Returns the model's creation time as a naive datetime in UTC."""
+ """:class:`datetime.datetime`: Returns the model's creation time as an aware datetime in UTC."""
raise NotImplementedError
@@ -1176,13 +1176,16 @@ class Messageable(Protocol):
that this would make it a slow operation.
before: Optional[Union[:class:`~discord.abc.Snowflake`, :class:`datetime.datetime`]]
Retrieve messages before this date or message.
- If a date is provided it must be a timezone-naive datetime representing UTC time.
+ If a datetime is provided, it is recommended to use a UTC aware datetime.
+ If the datetime is naive, it is assumed to be local time.
after: Optional[Union[:class:`~discord.abc.Snowflake`, :class:`datetime.datetime`]]
Retrieve messages after this date or message.
- If a date is provided it must be a timezone-naive datetime representing UTC time.
+ If a datetime is provided, it is recommended to use a UTC aware datetime.
+ If the datetime is naive, it is assumed to be local time.
around: Optional[Union[:class:`~discord.abc.Snowflake`, :class:`datetime.datetime`]]
Retrieve messages around this date or message.
- If a date is provided it must be a timezone-naive datetime representing UTC time.
+ If a datetime is provided, it is recommended to use a UTC aware datetime.
+ If the datetime is naive, it is assumed to be local time.
When using this argument, the maximum limit is 101. Note that if the limit is an
even number then this will return at most limit + 1 messages.
oldest_first: Optional[:class:`bool`]