Skip to content

feat(components): add send_v2, edit_v2 convenience methods#1532

Open
Enegg wants to merge 4 commits into
DisnakeDev:masterfrom
Enegg:send_v2
Open

feat(components): add send_v2, edit_v2 convenience methods#1532
Enegg wants to merge 4 commits into
DisnakeDev:masterfrom
Enegg:send_v2

Conversation

@Enegg

@Enegg Enegg commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a feeler whether this feature is useful or not

This PR adds new convenience methods:

  • Messageable.send_v2
  • Message.edit_v2
  • InteractionResponse.{send,edit}_message_v2
  • [TODO] async_.Webhook.send_v2
  • [TODO] async_.WebhookMessage.edit_v2
    • sync.Webhook.send and sync.WebhookMessage.edit don't support components?

which provide a simplified interface to sending components v2.

For example, InteractionResponse.send_message:

async def send_message(
    self,
    content: str | None = None,
    *,
    embed: Embed = MISSING,
    embeds: list[Embed] = MISSING,
    file: File = MISSING,
    files: list[File] = MISSING,
    allowed_mentions: AllowedMentions = MISSING,
    view: View = MISSING,
    components: MessageComponents = MISSING,
    tts: bool = False,
    ephemeral: bool = MISSING,
    suppress_embeds: bool = MISSING,
    flags: MessageFlags = MISSING,
    delete_after: float = MISSING,
    poll: Poll = MISSING,
) -> None:

Becomes: 1

async def send_message_v2(
    self,
    components: MessageComponents,
    *,
    files: File | Sequence[File] = (),
    allowed_mentions: AllowedMentions = MISSING,
    ephemeral: bool = MISSING,
    flags: MessageFlags = MISSING,
) -> None:

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running uv run nox -s lint
    • I have type-checked the code by running uv run nox -s pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

Footnotes

  1. I'm not sure if tts and suppress_embeds work with components, hence omitted; I'm not a fan of the delete_after functionality

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 disnake | 🛠️ Build #32914434 | 📁 Comparing 728aeb5 against latest (c73b345)

  🔍 Preview build  

48 files changed · ± 48 modified

± Modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant