aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/models.py12
-rw-r--r--api/tests/test_models.py1
2 files changed, 13 insertions, 0 deletions
diff --git a/api/models.py b/api/models.py
index bb3489d0..abbaa8bc 100644
--- a/api/models.py
+++ b/api/models.py
@@ -226,6 +226,18 @@ class Message(ModelReprMixin, models.Model):
on_delete=models.CASCADE,
help_text="The author of this message."
)
+ channel_id = models.BigInteger(
+ help_text=(
+ "The channel ID that this message was "
+ "sent in, taken from Discord."
+ ),
+ validators=(
+ MinValueValidator(
+ limit_value=0,
+ message="Channel IDs cannot be negative."
+ ),
+ )
+ )
content = models.CharField(
max_length=2_000,
help_text="The content of this message, taken from Discord."
diff --git a/api/tests/test_models.py b/api/tests/test_models.py
index 92a59f46..b36f29b9 100644
--- a/api/tests/test_models.py
+++ b/api/tests/test_models.py
@@ -50,6 +50,7 @@ class StringDunderMethodTests(SimpleTestCase):
id=444, name='bill',
discriminator=5, avatar_hash=None
),
+ channel_id=666,
content="wooey",
embeds=[]
),