Skip to content

Commit

Permalink
Fix role icon argument not setting unicode_emoji to None (#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
argo0n authored Jan 28, 2022
1 parent 66887df commit a15aaf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions discord/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ async def edit(
position: int = MISSING,
reason: Optional[str] = MISSING,
icon: Optional[bytes] = MISSING,
unicode_emoji: str = MISSING
unicode_emoji: Optional[str] = MISSING
) -> Optional[Role]:
"""|coro|
Expand Down Expand Up @@ -409,7 +409,7 @@ async def edit(
reason: Optional[:class:`str`]
The reason for editing this role. Shows up on the audit log.
icon: Optional[:class:`bytes`]
A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG/WebP is supported.
A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG/WebP is supported. If this argument is passed, ``unicode_emoji`` is set to None.
Only available to guilds that contain ``ROLE_ICONS`` in :attr:`Guild.features`.
Could be ``None`` to denote removal of the icon.
unicode_emoji: Optional[:class:`str`]
Expand Down Expand Up @@ -461,6 +461,7 @@ async def edit(
payload['icon'] = None
else:
payload['icon'] = _bytes_to_base64_data(icon)
payload['unicode_emoji'] = None

if unicode_emoji is not MISSING:
payload['unicode_emoji'] = unicode_emoji
Expand Down

0 comments on commit a15aaf9

Please sign in to comment.