From 59f877fcf013c4ddeeb2b39fc21f03e76f995461 Mon Sep 17 00:00:00 2001 From: Michael H Date: Mon, 2 Sep 2024 10:53:31 -0400 Subject: [PATCH] Fix and add test for missing discord.Permission bits --- discord/permissions.py | 2 +- tests/test_permissions_all.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/test_permissions_all.py diff --git a/discord/permissions.py b/discord/permissions.py index 17c7b38c9..b553e2578 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -187,7 +187,7 @@ class Permissions(BaseFlags): permissions set to ``True``. """ # 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 def _timeout_mask(cls) -> int: diff --git a/tests/test_permissions_all.py b/tests/test_permissions_all.py new file mode 100644 index 000000000..883dc1b63 --- /dev/null +++ b/tests/test_permissions_all.py @@ -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())