aboutsummaryrefslogtreecommitdiff
path: root/discord/role.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/role.py')
-rw-r--r--discord/role.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/role.py b/discord/role.py
index a8ce4cea..ca9991b9 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -258,6 +258,13 @@ class Role(Hashable):
"""
return self.tags is not None and self.tags.is_integration()
+ def is_assignable(self):
+ """:class:`bool`: Whether the role is able to be assigned or removed by the bot.
+
+ .. versionadded:: 2.0
+ """
+ return not self.is_default() and not self.managed and self.guild.me.top_role > self
+
@property
def permissions(self):
""":class:`Permissions`: Returns the role's permissions."""