Summary
It is not possible to use the PartialMessage.edit method when passing a DesignerView instance as view.
Reproduction Steps
- Send a message with the bot
- Get its id
- Use
message = get_partial_message(id)
- Use
await message.edit(view=DesignerView(TextDisplay("Hello World")))
Minimal Reproducible Code
import discord
import os
from dotenv import load_dotenv
import logging
logging.basicConfig(level=logging.INFO)
load_dotenv()
bot = discord.Bot()
@bot.slash_command()
async def ping(ctx: discord.ApplicationContext):
await ctx.respond("Pong")
message = await ctx.send("Hello World")
view = discord.ui.DesignerView(discord.ui.TextDisplay("Hello World"))
partial_message = ctx.channel.get_partial_message(message.id)
await partial_message.edit(view=view)
bot.run(os.getenv("TOKEN_2"))
Expected Results
The message to be edited
Actual Results
The edit fails with
File "[...].venv\Lib\site-packages\discord\message.py", line 2578, in edit
data = await self._state.http.edit_message(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[...].venv\Lib\site-packages\discord\http.py", line 393, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0: Value of field "type" must be one of (1,).
Intents
n/a
System Information
Checklist
Additional Context
No response
Summary
It is not possible to use the
PartialMessage.editmethod when passing aDesignerViewinstance as view.Reproduction Steps
message = get_partial_message(id)await message.edit(view=DesignerView(TextDisplay("Hello World")))Minimal Reproducible Code
Expected Results
The message to be edited
Actual Results
The edit fails with
Intents
n/a
System Information
Checklist
Additional Context
No response