diff --git a/CHANGELOG.md b/CHANGELOG.md index a22982689d..93ac55dba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -158,6 +158,8 @@ These changes are available on the `master` branch, but have not yet been releas `Webhook` class. ([#2156](https://github.com/Pycord-Development/pycord/pull/2156)) - Fixed `ScheduledEvent.creator_id` returning `str` instead of `int`. ([#2162](https://github.com/Pycord-Development/pycord/pull/2162)) +- Fixed initial message inside of the create thread payload sending legacy beta payload. + ([#2191](https://github.com/Pycord-Development/pycord/pull/2191)) ## [2.4.1] - 2023-03-20 diff --git a/discord/http.py b/discord/http.py index 465b821fae..05fff4b14f 100644 --- a/discord/http.py +++ b/discord/http.py @@ -1183,37 +1183,42 @@ def start_forum_thread( "auto_archive_duration": auto_archive_duration, "invitable": invitable, } - if content: - payload["content"] = content if applied_tags: payload["applied_tags"] = applied_tags + message = {} + + if content: + message["content"] = content + if embed: - payload["embeds"] = [embed] + message["embeds"] = [embed] if embeds: - payload["embeds"] = embeds + message["embeds"] = embeds if nonce: - payload["nonce"] = nonce + message["nonce"] = nonce if allowed_mentions: - payload["allowed_mentions"] = allowed_mentions + message["allowed_mentions"] = allowed_mentions if components: - payload["components"] = components + message["components"] = components if stickers: - payload["sticker_ids"] = stickers + message["sticker_ids"] = stickers if rate_limit_per_user: - payload["rate_limit_per_user"] = rate_limit_per_user + message["rate_limit_per_user"] = rate_limit_per_user + + if message != {}: + payload["message"] = message - # TODO: Once supported by API, remove has_message=true query parameter route = Route( "POST", - "/channels/{channel_id}/threads?has_message=true", + "/channels/{channel_id}/threads", channel_id=channel_id, )