Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix role icon argument not setting unicode_emoji to None #876

Merged
merged 3 commits into from
Jan 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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