From fb1f9ac65977f82cbec2ab89f975fa8b21eb48f9 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 21 Nov 2016 03:12:44 -0500 Subject: [PATCH] Add PermissionOverwrite.is_empty to query empty state of an overwrite. Fixes #382 --- discord/permissions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discord/permissions.py b/discord/permissions.py index 74be8a434..b5b665555 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -557,6 +557,14 @@ class PermissionOverwrite: return ret + def is_empty(self): + """Checks if the permission overwrite is currently empty. + + An empty permission overwrite is one that has no overwrites set + to True or False. + """ + return all(x is None for x in self._values.values()) + def update(self, **kwargs): """Bulk updates this permission overwrite object.