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

Add Paid reaction #156

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Froctnow
Copy link

@Froctnow Froctnow commented Sep 12, 2024

Summary by Sourcery

Add a new 'Paid' reaction type to the reaction system, enabling the handling and serialization of paid reactions alongside existing emoji and custom emoji types.

New Features:

  • Introduce a new 'Paid' reaction type to the existing reaction system, allowing for reactions that are categorized as paid.

Copy link
Contributor

sourcery-ai bot commented Sep 12, 2024

Reviewer's Guide by Sourcery

This pull request adds support for a new "Paid" reaction type to the existing reaction system. The changes involve modifying the ReactionType struct and updating the JSON marshaling and unmarshaling methods to handle the new reaction type.

File-Level Changes

Change Details Files
Add new Paid reaction type to ReactionType struct
  • Add Paid field of type *ReactionTypePaid to ReactionType struct
  • Create new ReactionTypePaid struct with Type field
reactions.go
types_gen.go
Update JSON marshaling for ReactionType to include Paid reaction
  • Add case for Paid reaction in MarshalJSON method
  • Set Type field to 'paid' for Paid reaction
reactions.go
Update JSON unmarshaling for ReactionType to include Paid reaction
  • Add case for 'paid' type in UnmarshalJSON method
  • Create and unmarshal into ReactionTypePaid for 'paid' type
  • Add debug print statement for reaction in default case
reactions.go

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Froctnow - I've reviewed your changes - here's some feedback:

Overall Comments:

  • There's a fmt.Println(reaction) in the default case of the UnmarshalJSON function. This looks like debugging code and should be removed before merging.
  • The ReactionTypePaid struct only contains a Type field. Consider if there are any other attributes specific to paid reactions that should be included, similar to how CustomEmojiID is included for custom emoji reactions.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

types_gen.go Show resolved Hide resolved
reactions.go Outdated Show resolved Hide resolved
@Froctnow
Copy link
Author

@mr-linch Hi, telegram has released update with a new reaction type. I've added new reaction type in your code, but there is a problem, the package with proto (or something else source) is private, I mean go-tg-gen, and I've made changes in code, but you have to change proto and update PR, or create new with correct changes

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.

1 participant