diff options
| author | Michael H <[email protected]> | 2019-03-17 09:15:10 -0400 |
|---|---|---|
| committer | Michael H <[email protected]> | 2019-03-17 09:17:14 -0400 |
| commit | 03616b91db4e41eef76101d66e9017670ddba753 (patch) | |
| tree | 78d5ae7ae9399a883d4fd06e667c88ad93cc0c9c /discord/embeds.py | |
| parent | Fix pagination of huge command help messages (> ~2,000 chars) (diff) | |
| download | discord.py-03616b91db4e41eef76101d66e9017670ddba753.tar.xz discord.py-03616b91db4e41eef76101d66e9017670ddba753.zip | |
Fix embed to_dict timestamp handling for python 3.5
resolves #1992
Diffstat (limited to 'discord/embeds.py')
| -rw-r--r-- | discord/embeds.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/embeds.py b/discord/embeds.py index 5dcc92a8..88123cbc 100644 --- a/discord/embeds.py +++ b/discord/embeds.py @@ -509,7 +509,10 @@ class Embed: pass else: if timestamp: - result['timestamp'] = timestamp.astimezone(tz=datetime.timezone.utc).isoformat() + if timestamp.tzinfo: + result['timestamp'] = timestamp.astimezone(tz=datetime.timezone.utc).isoformat() + else: + result['timestamp'] = timestamp.replace(tzinfo=timezone.utc).isoformat() # add in the non raw attribute ones if self.type: |