aboutsummaryrefslogtreecommitdiff
path: root/discord/embeds.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/embeds.py')
-rw-r--r--discord/embeds.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/discord/embeds.py b/discord/embeds.py
index 47f4b07a..f57943f7 100644
--- a/discord/embeds.py
+++ b/discord/embeds.py
@@ -202,8 +202,6 @@ class Embed:
self.url = str(self.url)
if timestamp:
- if timestamp.tzinfo is None:
- timestamp = timestamp.astimezone()
self.timestamp = timestamp
@classmethod
@@ -327,7 +325,11 @@ class Embed:
@timestamp.setter
def timestamp(self, value: MaybeEmpty[datetime.datetime]):
- if isinstance(value, (datetime.datetime, _EmptyEmbed)):
+ if isinstance(value, datetime.datetime):
+ if value.tzinfo is None:
+ value = value.astimezone()
+ self._timestamp = value
+ elif isinstance(value, _EmptyEmbed):
self._timestamp = value
else:
raise TypeError(f"Expected datetime.datetime or Embed.Empty received {value.__class__.__name__} instead")