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

feat: add Message._raw_data #2670

Merged
merged 11 commits into from
Dec 30, 2024
Merged

Conversation

tibue99
Copy link
Contributor

@tibue99 tibue99 commented Dec 15, 2024

Summary

This PR adds Message.data, which is useful for handling message data or creating transcripts.

Information

  • 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, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • 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.
  • I have updated the changelog to include these changes.

discord/message.py Outdated Show resolved Hide resolved
discord/message.py Outdated Show resolved Hide resolved
This reverts commit a779c6f.
discord/message.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
discord/message.py Outdated Show resolved Hide resolved
@tibue99 tibue99 requested a review from Paillat-dev December 15, 2024 22:28
discord/message.py Outdated Show resolved Hide resolved
@tibue99 tibue99 changed the title feat: add message.to_dict feat: add Message.data Dec 16, 2024
Lulalaby
Lulalaby previously approved these changes Dec 16, 2024
@Lulalaby Lulalaby enabled auto-merge (squash) December 16, 2024 11:26
@Lulalaby Lulalaby requested review from plun1331 and removed request for ChickenDevs December 16, 2024 11:27
Copy link
Member

@JustaSqu1d JustaSqu1d left a comment

Choose a reason for hiding this comment

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

MessagePayload is not a documented class. Please add the class to documentation.

@DA-344
Copy link
Contributor

DA-344 commented Dec 17, 2024

Or maybe document it as dict on the doc string and type annotate it as MessagePayload

auto-merge was automatically disabled December 17, 2024 17:26

Head branch was pushed to by a user without write access

@JustaSqu1d
Copy link
Member

JustaSqu1d commented Dec 17, 2024

Or maybe document it as dict on the doc string and type annotate it as MessagePayload

MessagePayload is not documented and shouldn't be used as a type hint for a public attribute.

@tibue99
Copy link
Contributor Author

tibue99 commented Dec 19, 2024

MessagePayload is not documented and shouldn't be used as a type hint for a public attribute.

It's done this way for interaction.data. If I should add MessagePayload to the docs, please tell me where to add it.

@Dorukyum
Copy link
Member

Do we really need to store the raw message data publicly? Interaction.data exists mainly because it's documented.

@JustaSqu1d
Copy link
Member

Do we really need to store the raw message data publicly? Interaction.data exists mainly because it's documented.

Are you suggesting something like message._data or message.__data?

@Dorukyum
Copy link
Member

I'm skeptical about the necessity of this attribute

@tibue99
Copy link
Contributor Author

tibue99 commented Dec 28, 2024

This attribute is useful for handling transcripts and other cases where messages need to be stored. It doesn't matter to me if it's public or private, but I strongly recommend adding it. Users should be able to use it freely if they need to.

@Paillat-dev
Copy link
Contributor

I see how having Message.data might be incorrect since data is not an attribute of the discord object. Maybe something like Message.payload or Message._payload or Message.raw_data might make more sense? Idk

Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

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

rename to raw_data
make private

@Lulalaby
Copy link
Member

I can see value to adding it, but only as undocumented private field.

@tibue99 tibue99 changed the title feat: add Message.data feat: add Message._raw_data Dec 30, 2024
@Lulalaby Lulalaby enabled auto-merge (squash) December 30, 2024 17:05
@Lulalaby Lulalaby merged commit c37e116 into Pycord-Development:master Dec 30, 2024
27 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.

6 participants