From 57695117794e0098d660722b209ffaad26e350cf Mon Sep 17 00:00:00 2001 From: Anurag Singh <30367300+anurag-7@users.noreply.github.com> Date: Mon, 4 May 2020 09:29:37 +0530 Subject: [PATCH] allow passing color int to role.edit --- discord/role.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/discord/role.py b/discord/role.py index 08a173385..24ae3bdd8 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),