Skip to content

Webhook edit does not include with_components=true, so COMPONENTS_V2 edits are ignored #10395

@EngineExt

Description

@EngineExt

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

  1. Send a message via a regular incoming webhook using COMPONENTS_V2 (discord.ui.LayoutView with TextDisplay).
  2. Edit the same webhook message and change the TextDisplay content.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugA bug report that needs triaging

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions