JDA icon indicating copy to clipboard operation
JDA copied to clipboard

Add Attachment Support to MessageBuilder

Open rarcher opened this issue 4 years ago • 2 comments

  • [x] I have checked for similar issues.
  • [x] I have updated to the [latest JDA version][download].
  • [x] I have checked the branches or the maintainers' PRs for upcoming features.

Feature Request

Add support for file attachments to the MessageBuilder class. MessageBuilder currently provides most options for construction of a new Message, but Attachment support is conspicuously absent.

Example Use-Case

When two or more objects are collaborating on the construction of a Message, pass a MessageBuilder around as a container. Use the new functionality to attach files, when necessary.

Alternative Option

Add getter methods to MessageAction. MessageAction supports mutable Message construction, similar to MessageBuilder, and does provide Attachment support. However, it does not offer any way to read data already inside it. This can be quite inconvenient if collaborating objects need to read each other's contributions to a Message under construction.

rarcher avatar Jun 18 '21 02:06 rarcher

We are intending to introduce interfaces to unify the MessageBuilder and the MessageAction related RestActions in v5 which will bring support for attachments to MessageBuilder

DV8FromTheWorld avatar Sep 19 '21 05:09 DV8FromTheWorld

That sounds perfect, actually.

rarcher avatar Sep 19 '21 19:09 rarcher

@MinnDevelopment Awesome! Thanks man!

rarcher avatar Aug 16 '22 16:08 rarcher