forked from serenity-rs/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CreateAttachment.description and EditAttachment (serenity-rs#2575)
* Add attachments to payloads, support description * Add separate struct for new message attachments * Make everything cleaner (in my judgment, that is) CreateAttachment is now Serialize and can be used for the `attachments` field directly, eliminating the extra `files` fields. Attachment handling is now centralized in EditAttachments. This removes redundancy in serenity code and makes it more maintainable. Also, by modifying attachments through EditAttachments instead of ad-hoc methods on the builder itself, the side effects of adding attachments can now be documented much more clearly, as well as mirroring those side effects in the builder syntax (also see serenity-rs#2570 (comment)). The old ad-hoc methods are kept for backwards-compatibility, but marked deprecated * new_keep_all -> keep_all as per mkrasnitski/polarbits' suggestion * Update src/builder/create_attachment.rs Co-authored-by: Michael Krasnitski <[email protected]> * Update src/builder/create_attachment.rs Co-authored-by: Michael Krasnitski <[email protected]> * Rename dont_keep to remove As per the principle of "do what you can be blamed the least for", even though I still don't like this rename * Add MultipartUpload enum * Undeprecate methods * Apply mkrasnitski/polarbits' suggestions * Update src/builder/edit_interaction_response.rs Co-authored-by: Michael Krasnitski <[email protected]> * Update src/builder/edit_interaction_response.rs Co-authored-by: Michael Krasnitski <[email protected]> * Apply suggestions from code review Co-authored-by: Michael Krasnitski <[email protected]> * Update src/builder/create_attachment.rs Co-authored-by: Michael Krasnitski <[email protected]> * Update src/builder/create_attachment.rs Co-authored-by: Michael Krasnitski <[email protected]> * Fix CI --------- Co-authored-by: Kneemund <[email protected]> Co-authored-by: Michael Krasnitski <[email protected]> Co-authored-by: Michael Krasnitski <[email protected]>
- Loading branch information
1 parent
7e1a6eb
commit 2a81062
Showing
11 changed files
with
366 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.