Creating a forum thread with an image attached #1948
-
I'm trying to create a forum thread with an image, similar to what I'd get by uploading an image using the clickable area in the top right: My code uses something along the lines of: from discord import File
channel.create_thread('title', 'description', file=File(path)) But the API sends me 400:
If I remove the What confuses me is that the initial forum thread message does support embeds. I can add embeds and buttons just fine. But if I wanted to have an embed with a thumbnail, I'd need to have from discord import File, Embed
embed = Embed(...)
embed.set_thumbnail(url=f"attachment://{path.name}")
channel.create_thread('title', 'description', file=File(path)) But this doesn't seem to be possible then? Because as soon as I put anything into the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Okay, so right after posting this, I continued working on workarounds. I managed to get the image uploaded using this convoluted approach: thread = await channel.create_thread(...)
message = await thread.fetch_message(thread.id)
await message.edit(file=File(path)) I tried |
Beta Was this translation helpful? Give feedback.
-
This should have been an issue, so I investigated and created one #1949 message = thread.get_partial_message(thread.id) |
Beta Was this translation helpful? Give feedback.
This should have been an issue, so I investigated and created one #1949
As for your workaround, you don't need to fetch the message, just use a partial: