mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
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.
|
||||
|
||||
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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user