-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Summary
Editing webhook messages that use COMPONENTS_V2 does not update components because discord.py does not include the required with_components=true query parameter when editing webhook messages.
Reproduction Steps
- Send a message via a regular incoming webhook using COMPONENTS_V2 (discord.ui.LayoutView with TextDisplay).
- Edit the same webhook message and change the TextDisplay content.
- The edit request succeeds (HTTP 200 OK), but the component content does not change.
Minimal Reproducible Code
import discord
from discord import Webhook
import aiohttp
# COMPONENTS_V2 message
layout = discord.ui.LayoutView(
discord.ui.TextDisplay(content="Text in content")
)
await webhook.send(view=layout)
# Attempt to edit COMPONENTS_V2 message
new_layout = discord.ui.LayoutView(
discord.ui.TextDisplay(content="EDIT Text in content")
)
await webhook.edit_message(message_id, view=new_layout)Expected Results
The TextDisplay component content should be updated when editing a webhook message, the same way it is updated when sending a webhook message with components.
Actual Results
The edit request succeeds (HTTP 200 OK), but the components are ignored and the visible message content remains unchanged.
Intents
discord.Intents.default()
System Information
- Python v3.11.9-final
- discord.py v2.6.4-final
- aiohttp v3.13.2
- system info: Windows 10 10.0.19045
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
According to the Discord API documentation, editing webhook messages that contain components requires the with_components=true query parameter.
discord.py correctly includes this parameter when sending webhook messages, but it is missing when editing them.
Relevant code:
https://github.com/Rapptz/discord.py/blob/master/discord/webhook/async_.py#L2002-L2125
There is currently no way for users to opt-in or pass this parameter manually during webhook edits.