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

Parse as embed update if parsing as message fails #37

Merged
merged 2 commits into from
May 13, 2020

Conversation

Billzabob
Copy link
Owner

No description provided.

@Billzabob
Copy link
Owner Author

Closes #32

@Billzabob Billzabob requested a review from hogiyogi597 May 13, 2020 01:30
@codecov
Copy link

codecov bot commented May 13, 2020

Codecov Report

Merging #37 into master will increase coverage by 0.24%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   50.37%   50.62%   +0.24%     
==========================================
  Files          59       60       +1     
  Lines         397      399       +2     
==========================================
+ Hits          200      202       +2     
  Misses        197      197              
Impacted Files Coverage Δ
src/main/scala/dissonance/model/Event.scala 72.88% <100.00%> (ø)
...c/main/scala/dissonance/model/message/Update.scala 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30e148d...defdae0. Read the comment docs.

) extends Update

implicit val config: Configuration = Configuration.default.withSnakeCaseMemberNames
implicit val updateDecoder: Decoder[Update] = Decoder[Message].map(Edit).widen[Update] or deriveConfiguredDecoder[EmbedUpdate].widen[Update]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting. So widen basically casts to a supertype?
Also, where does this or come from? Is that from circe?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ya I actually want to understand it better because I forgot what makes it legal , remind me to ask in Gitter tomorrow. Ya the or comes from Circe 👍

hogiyogi597
hogiyogi597 previously approved these changes May 13, 2020
@Billzabob Billzabob merged commit dfeb378 into master May 13, 2020
@Billzabob Billzabob deleted the update-embed-events branch May 14, 2020 06:08
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.

MESSAGE_UPDATE generated by embed has hardly any fields for its Message
2 participants