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 response parsing in UpdatingMessages #131

Merged

Conversation

balsoft
Copy link
Contributor

@balsoft balsoft commented Dec 22, 2022

Response to editMessage* requests is either "true", indicating that the edited message has been inline, or a message otherwise. This was (intuitively) represented with Either Bool Message. However, Aeson understands this as a literal sum type of Left _ | Right _, which is not the intended semantics. Replace Either with a custom data type which exhibits the proper parsing behaviour.

Fixes #130

Response to editMessage* requests is either "true", indicating that the
edited message has been inline, or a message otherwise. This was
(intuitively) represented with Either Bool Message. However, Aeson
understands this as a literal sum type of Left _ | Right _, which is not
the intended semantics. Replace Either with a custom data type which
exhibits the proper parsing behaviour.
@balsoft
Copy link
Contributor Author

balsoft commented Dec 22, 2022

Tested with editMessageReplyMarkup, which used to fail but now works.

@swamp-agr
Copy link
Collaborator

Cool stuff, thank you!

@swamp-agr swamp-agr merged commit e23ecd3 into fizruk:master Dec 24, 2022
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.

Telegram.Bot.API.UpdatingMessages.editMessageReplyMarkup is seemingly broken
2 participants