Repository: Pycord-Development/pycord

Issue:
Forum channels still use payloads from early beta
### Problem

Discord informed us that our payloads for post creations in forum channels are invalid.

Before we could specify the message directly in the root object as `content`, as well as other fields.

This was changed long ago tho.

#### References

https://github.com/Pycord-Development/pycord/blob/0763261e2cfde59641bb2f46b704c6acee5fa712/discord/http.py#L1186-L1208

- Old Pull Request: https://github.com/Pycord-Development/pycord/pull/1249
- Beta information: https://discord.com/channels/613425648685547541/837051880982577223/961720121414541393

### Solution

The inner payload for the message has to be a message payload.
```json
{
    "message": {
        // message object properties
    }
}
```

#### References

- Docs: https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel-jsonform-params

### Additional

While looking through blame, it came to our attention that there's another problem with a certain route which had a special param before release to test.
The param needs to be removed.

#### References

https://github.com/Pycord-Development/pycord/blob/0763261e2cfde59641bb2f46b704c6acee5fa712/discord/http.py#L1214-L1218

- Original issue: https://github.com/Pycord-Development/pycord/issues/1735
Once supported by API, remove has_message=true query parameter


Line: 1196
https://github.com/Pycord-Development/pycord/blob/6ab3292b8984cce19e00afaead0c080acf9ec687//discord/http.py#L1193-L1203


Discussion:

Resolving patch:
diff --git a/discord/http.py b/discord/http.py
--- 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,
         )
 


Test patch: