Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UpdateAsync Remove Attachment Bug #2766

Merged
merged 5 commits into from Sep 2, 2023

Conversation

supitsmike
Copy link
Contributor

Description

This PR adds the ability to remove attachments for a IModalInteraction when calling UpdateAsync.

Changes

  • Add Attachments object to InteractionCallbackData.
  • Update UpdateAsync to add Attachments object to both RestModal and SocketModal.

Related Issues

@DeclanFrampton
Copy link
Contributor

Not the best way, however, this has already been pushed awaiting review and merge #2753

@supitsmike
Copy link
Contributor Author

Not the best way, however, this has already been pushed awaiting review and merge #2753

Your PR #2753 and my PR #2766 are fixing a similar issue it 2 totally different places.
I pulled your PR and tested it and it still kept the image after setting Attachments to null.

@DeclanFrampton
Copy link
Contributor

DeclanFrampton commented Aug 21, 2023

Issue resolves another issue similar to #2753 and #2236. Tested changes and approve the changes within this PR.

Can we get high priority on this for next release @Misha-133

@Misha-133 Misha-133 reopened this Aug 21, 2023
Copy link
Member

@Misha-133 Misha-133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a FileAttachment property to json model would not allow sending new attachments.
Same approach as in SocketMessageComponent should be used instead.

Additionally, RestMessageComponent.Update should also be updated to allow setting Attachments

@supitsmike
Copy link
Contributor Author

Adding a FileAttachment property to json model would not allow sending new attachments. Same approach as in SocketMessageComponent should be used instead.

Additionally, RestMessageComponent.Update should also be updated to allow setting Attachments

@Misha-133 Updated those functions and RestMessageComponent.Update

@Misha-133 Misha-133 merged commit a668757 into discord-net:dev Sep 2, 2023
3 checks passed
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.

None yet

4 participants