Fix and add test for missing discord.Permission bits

This commit is contained in:
Michael H 2024-09-02 10:53:31 -04:00 committed by GitHub
parent df4b1c88df
commit 59f877fcf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -187,7 +187,7 @@ class Permissions(BaseFlags):
permissions set to ``True``. permissions set to ``True``.
""" """
# Some of these are 0 because we don't want to set unnecessary bits # Some of these are 0 because we don't want to set unnecessary bits
return cls(0b0000_0000_0000_0010_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111) return cls(0b0000_0000_0000_0110_0111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111)
@classmethod @classmethod
def _timeout_mask(cls) -> int: def _timeout_mask(cls) -> int:

View File

@ -0,0 +1,7 @@
import discord
from functools import reduce
from operator import or_
def test_permissions_all():
assert discord.Permissions.all().value == reduce(or_, discord.Permissions.VALID_FLAGS.values())