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

Make the fields of Telegram types really optional (right now LinkPreviewOptions, ReplyParameters only) #320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uralm1
Copy link

@uralm1 uralm1 commented Nov 8, 2024

This PR is an example approach how to make optional fields of a secondary type classes really optional.
I wrapped optional fields with boost::optional, right now only in LinkPreviewOptions, ReplyParameters classes.

It solves the problem described in issue #308

There are many such classes in Api, so consider this change as an example approach. Any way, it covers most used sendMessage() function, and solves problem with replies.

@Royna2544
Copy link
Contributor

Royna2544 commented Nov 13, 2024

Code becomes really complicated, tho, wrapping everything in boost optional?
Check my fork, can you test it?
https://github.com/Royna2544/tgbot-cpp

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.

2 participants