Add Role.is_assignable()

This commit is contained in:
Tyler 2021-05-27 23:53:23 -05:00 committed by GitHub
parent 65db814d4a
commit 6c8f1ccbdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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."""