Skip to content

Commit 92cdfea

Browse files
authored
fix: 🐛 handle None case for default_reaction_emoji in ForumChannel edit payload (#2739)
* 🐛 handle None case for `default_reaction_emoji` in ForumChannel edit payload * 📝 CHANGELOG.md
1 parent 36a9b44 commit 92cdfea

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ These changes are available on the `master` branch, but have not yet been releas
9797
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
9898
- Fixed `Subscription.renewal_sku_ids` not accepting `None` from the received payload.
9999
([#2709](https://github.com/Pycord-Development/pycord/pull/2709))
100+
- Fixed `ForumChannel.edit` allowing `default_reaction_emoji` to be `None`
101+
([#2739](https://github.com/Pycord-Development/pycord/pull/2739))
100102

101103
### Changed
102104

discord/abc.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,17 @@ async def _edit(
521521
)
522522
elif isinstance(default_reaction_emoji, str):
523523
default_reaction_emoji = PartialEmoji.from_str(default_reaction_emoji)
524+
elif default_reaction_emoji is None:
525+
pass
524526
else:
525527
raise InvalidArgument(
526-
"default_reaction_emoji must be of type: GuildEmoji | int | str"
528+
"default_reaction_emoji must be of type: GuildEmoji | int | str | None"
527529
)
528530

529531
options["default_reaction_emoji"] = (
530532
default_reaction_emoji._to_forum_reaction_payload()
533+
if default_reaction_emoji
534+
else None
531535
)
532536

533537
if options:

0 commit comments

Comments
 (0)