Skip to content

Commit a15aaf9

Browse files
authored
Fix role icon argument not setting unicode_emoji to None (#876)
1 parent 66887df commit a15aaf9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

discord/role.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ async def edit(
374374
position: int = MISSING,
375375
reason: Optional[str] = MISSING,
376376
icon: Optional[bytes] = MISSING,
377-
unicode_emoji: str = MISSING
377+
unicode_emoji: Optional[str] = MISSING
378378
) -> Optional[Role]:
379379
"""|coro|
380380
@@ -409,7 +409,7 @@ async def edit(
409409
reason: Optional[:class:`str`]
410410
The reason for editing this role. Shows up on the audit log.
411411
icon: Optional[:class:`bytes`]
412-
A :term:`py:bytes-like object` representing the icon. Only PNG/JPEG/WebP is supported.
412+
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.
413413
Only available to guilds that contain ``ROLE_ICONS`` in :attr:`Guild.features`.
414414
Could be ``None`` to denote removal of the icon.
415415
unicode_emoji: Optional[:class:`str`]
@@ -461,6 +461,7 @@ async def edit(
461461
payload['icon'] = None
462462
else:
463463
payload['icon'] = _bytes_to_base64_data(icon)
464+
payload['unicode_emoji'] = None
464465

465466
if unicode_emoji is not MISSING:
466467
payload['unicode_emoji'] = unicode_emoji

0 commit comments

Comments
 (0)