diff options
author | 2019-10-28 18:20:07 +0100 | |
---|---|---|
committer | 2019-10-28 18:20:07 +0100 | |
commit | ee3f4f937c99ef3db92afc2fcba746003ec694f0 (patch) | |
tree | 2510fda8a4166588b9d6d1283c057adcd6306c54 /pydis_site/apps | |
parent | Merge pull request #294 from bsoyka/patch-1 (diff) |
Add a attachments field to the message model
Diffstat (limited to 'pydis_site/apps')
-rw-r--r-- | pydis_site/apps/api/models/bot/message.py | 6 | ||||
-rw-r--r-- | pydis_site/apps/api/serializers.py | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/pydis_site/apps/api/models/bot/message.py b/pydis_site/apps/api/models/bot/message.py index 31316a01..72b0b61a 100644 --- a/pydis_site/apps/api/models/bot/message.py +++ b/pydis_site/apps/api/models/bot/message.py @@ -51,6 +51,12 @@ class Message(ModelReprMixin, models.Model): ), help_text="Embeds attached to this message." ) + attachments = pgfields.ArrayField( + models.URLField( + max_length=512 + ), + help_text="Attachments attached to this message." + ) @property def timestamp(self) -> datetime: diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py index 8a605612..e091ff4f 100644 --- a/pydis_site/apps/api/serializers.py +++ b/pydis_site/apps/api/serializers.py @@ -49,7 +49,8 @@ class DeletedMessageSerializer(ModelSerializer): fields = ( 'id', 'author', 'channel_id', 'content', - 'embeds', 'deletion_context' + 'embeds', 'deletion_context', + 'attachments' ) |