aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/models
diff options
context:
space:
mode:
authorGravatar Dennis Pham <[email protected]>2020-07-20 13:56:10 -0400
committerGravatar GitHub <[email protected]>2020-07-20 13:56:10 -0400
commitd720d56e8d99bcc5df1679cfe83593c39fc0cb0e (patch)
tree04aba87e98d75d5052371139cca202c25311dba2 /pydis_site/apps/api/models
parentBump jQuery version (diff)
parentFix misleading documentation (diff)
Merge pull request #370 from python-discord/role-reminders
Add mentions field to Reminders model
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r--pydis_site/apps/api/models/bot/reminder.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pydis_site/apps/api/models/bot/reminder.py b/pydis_site/apps/api/models/bot/reminder.py
index d53fedb5..4b5d15ca 100644
--- a/pydis_site/apps/api/models/bot/reminder.py
+++ b/pydis_site/apps/api/models/bot/reminder.py
@@ -1,3 +1,4 @@
+from django.contrib.postgres.fields import ArrayField
from django.core.validators import MinValueValidator
from django.db import models
@@ -45,6 +46,19 @@ class Reminder(ModelReprMixin, models.Model):
expiration = models.DateTimeField(
help_text="When this reminder should be sent."
)
+ mentions = ArrayField(
+ models.BigIntegerField(
+ validators=(
+ MinValueValidator(
+ limit_value=0,
+ message="Mention IDs cannot be negative."
+ ),
+ )
+ ),
+ default=list,
+ blank=True,
+ help_text="IDs of roles or users to ping with the reminder."
+ )
def __str__(self):
"""Returns some info on the current reminder, for display purposes."""