mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Simplify embed timestamp code due to it being fixed Discord side.
See https://github.com/hammerandchisel/discord-api-docs/issues/291
This commit is contained in:
parent
6c67910fa9
commit
1d3bb1f510
@ -460,14 +460,7 @@ class Embed:
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if timestamp:
|
if timestamp:
|
||||||
try:
|
|
||||||
aware = timestamp.astimezone(datetime.timezone.utc)
|
|
||||||
except ValueError:
|
|
||||||
# naive date time
|
|
||||||
result['timestamp'] = timestamp.isoformat()
|
result['timestamp'] = timestamp.isoformat()
|
||||||
else:
|
|
||||||
result['timestamp'] = aware.isoformat().replace('+00:00', 'Z')
|
|
||||||
|
|
||||||
|
|
||||||
# add in the non raw attribute ones
|
# add in the non raw attribute ones
|
||||||
if self.type:
|
if self.type:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user