Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Discord.py 1.7+ #534

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pydis_site/apps/api/migrations/0070_auto_20210618_2114.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.0.14 on 2021-06-18 21:14

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0069_documentationlink_validators'),
]

operations = [
migrations.AlterField(
model_name='role',
name='permissions',
field=models.BigIntegerField(help_text='The integer value of the permission bitset of this role from Discord.', validators=[django.core.validators.MinValueValidator(limit_value=0, message='Role permissions cannot be negative.')]),
),
]
8 changes: 2 additions & 6 deletions pydis_site/apps/api/models/bot/role.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from django.core.validators import MaxValueValidator, MinValueValidator
from django.core.validators import MinValueValidator
from django.db import models

from pydis_site.apps.api.models.mixins import ModelReprMixin
Expand Down Expand Up @@ -38,16 +38,12 @@ class Role(ModelReprMixin, models.Model):
),
help_text="The integer value of the colour of this role from Discord."
)
permissions = models.IntegerField(
permissions = models.BigIntegerField(
validators=(
MinValueValidator(
limit_value=0,
message="Role permissions cannot be negative."
),
MaxValueValidator(
limit_value=2 << 32,
message="Role permission bitset exceeds value of having all permissions"
)
),
help_text="The integer value of the permission bitset of this role from Discord."
)
Expand Down