|
|
@ -4,8 +4,6 @@ import warnings |
|
|
|
import functools |
|
|
|
import unicodedata |
|
|
|
|
|
|
|
from datetime import datetime as real_datetime |
|
|
|
|
|
|
|
from disco.types.base import ( |
|
|
|
SlottedModel, Field, ListField, AutoDictField, snowflake, text, |
|
|
|
datetime, enum, cached_property, |
|
|
@ -330,14 +328,6 @@ class MessageEmbed(SlottedModel): |
|
|
|
""" |
|
|
|
self.fields.append(MessageEmbedField(*args, **kwargs)) |
|
|
|
|
|
|
|
def to_dict(self, iso=False): |
|
|
|
data = super(MessageEmbed, self).to_dict() |
|
|
|
# Ensure api calls don't try to send a non-json serializable datetime object. |
|
|
|
if iso and isinstance(data.get("timestamp"), real_datetime): |
|
|
|
data["timestamp"] = data["timestamp"].isoformat() |
|
|
|
|
|
|
|
return data |
|
|
|
|
|
|
|
|
|
|
|
class MessageAttachment(SlottedModel): |
|
|
|
""" |
|
|
|