allow passing color int to role.edit
This commit is contained in:
parent
1e9937a234
commit
5769511779
@ -218,6 +218,9 @@ class Role(Hashable):
|
|||||||
use this.
|
use this.
|
||||||
|
|
||||||
All fields are optional.
|
All fields are optional.
|
||||||
|
|
||||||
|
.. versionchanged:: 1.4
|
||||||
|
Can now pass ``int`` to ``colour`` keyword-only parameter.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
@ -225,7 +228,7 @@ class Role(Hashable):
|
|||||||
The new role name to change to.
|
The new role name to change to.
|
||||||
permissions: :class:`Permissions`
|
permissions: :class:`Permissions`
|
||||||
The new permissions to change to.
|
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)
|
The new colour to change to. (aliased to color as well)
|
||||||
hoist: :class:`bool`
|
hoist: :class:`bool`
|
||||||
Indicates if the role should be shown separately in the member list.
|
Indicates if the role should be shown separately in the member list.
|
||||||
@ -257,6 +260,9 @@ class Role(Hashable):
|
|||||||
colour = fields['colour']
|
colour = fields['colour']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
colour = fields.get('color', self.colour)
|
colour = fields.get('color', self.colour)
|
||||||
|
|
||||||
|
if isinstance(colour, int):
|
||||||
|
colour = Colour(value=colour)
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
'name': fields.get('name', self.name),
|
'name': fields.get('name', self.name),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user