diff options
| author | Anurag Singh <[email protected]> | 2020-05-04 09:29:37 +0530 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-05-10 19:35:45 -0400 |
| commit | 57695117794e0098d660722b209ffaad26e350cf (patch) | |
| tree | a63f948027755c35cd2c89b9e3df49eceba68397 | |
| parent | Aliases passed as a list or as a tuple (diff) | |
| download | discord.py-57695117794e0098d660722b209ffaad26e350cf.tar.xz discord.py-57695117794e0098d660722b209ffaad26e350cf.zip | |
allow passing color int to role.edit
| -rw-r--r-- | discord/role.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/role.py b/discord/role.py index 08a17338..24ae3bdd 100644 --- a/discord/role.py +++ b/discord/role.py @@ -218,6 +218,9 @@ class Role(Hashable): use this. All fields are optional. + + .. versionchanged:: 1.4 + Can now pass ``int`` to ``colour`` keyword-only parameter. Parameters ----------- @@ -225,7 +228,7 @@ class Role(Hashable): The new role name to change to. permissions: :class:`Permissions` The new permissions to change to. - colour: :class:`Colour` + colour: Union[:class:`Colour`, :class:`int`] The new colour to change to. (aliased to color as well) hoist: :class:`bool` Indicates if the role should be shown separately in the member list. @@ -257,6 +260,9 @@ class Role(Hashable): colour = fields['colour'] except KeyError: colour = fields.get('color', self.colour) + + if isinstance(colour, int): + colour = Colour(value=colour) payload = { 'name': fields.get('name', self.name), |