diff options
| author | Rapptz <[email protected]> | 2016-11-21 03:12:44 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-11-21 03:12:44 -0500 |
| commit | fb1f9ac65977f82cbec2ab89f975fa8b21eb48f9 (patch) | |
| tree | 3f0a87b6169fa1317347039b9558dc719b78f242 | |
| parent | Add Permissions.update and PermissionOverwrite.update for bulk edits. (diff) | |
| download | discord.py-fb1f9ac65977f82cbec2ab89f975fa8b21eb48f9.tar.xz discord.py-fb1f9ac65977f82cbec2ab89f975fa8b21eb48f9.zip | |
Add PermissionOverwrite.is_empty to query empty state of an overwrite.
Fixes #382
| -rw-r--r-- | discord/permissions.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/discord/permissions.py b/discord/permissions.py index 74be8a43..b5b66555 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. |