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

Implemented attachments in Webhook.edit_message and WebhookMessage.edit #712

Merged
merged 3 commits into from
Jan 18, 2022

Conversation

Vioshim
Copy link
Contributor

@Vioshim Vioshim commented Jan 5, 2022

Summary

This allows webhooks to be able to edit attachments according to the implementation in Discord's documentation

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why
  • 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, typehinting, examples, ...)

Copy link
Member

@plun1331 plun1331 left a comment

Choose a reason for hiding this comment

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

Passing files to this without attachments would replace all of the message's attachments with the files passed.
Other than that, looks fine.

@Vioshim
Copy link
Contributor Author

Vioshim commented Jan 7, 2022

Passing files to this without attachments would replace all of the message's attachments with the files passed. Other than that, looks fine.

As shown in the Discord server discussion, given that the payload never adds the parameter attachment in such cases, it shouldn't have such issue given how the API works, instead it'd simply append files in the message. See Documentation as Reference

The replacement would only happen if the user provides a list of attachments, even if it's zero length.

Expected Behaviour

@Lulalaby
Copy link
Member

Lulalaby commented Jan 7, 2022

Passing files to this without attachments would replace all of the message's attachments with the files passed.

This is the future plan of discord.

The replacement would only happen if the user provides a list of attachments, even if it's zero length.

For now correct.
It changes tho in v10

@Lulalaby Lulalaby added this to the v2.0 milestone Jan 7, 2022
@Lulalaby Lulalaby added priority: medium Medium Priority feature Implements a feature Merge with squash labels Jan 7, 2022
@krittick
Copy link
Contributor

Since this is existing API functionality that we currently lack, I'm good with merging this now and then updating for API v10 once that arrives.

@krittick krittick enabled auto-merge January 13, 2022 00:01
@Lulalaby Lulalaby disabled auto-merge January 18, 2022 01:11
@Lulalaby Lulalaby merged commit d2d4ce5 into Pycord-Development:master Jan 18, 2022
VincentRPS pushed a commit to VincentRPS/pycord that referenced this pull request Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Implements a feature priority: medium Medium Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants