tgbot-cpp icon indicating copy to clipboard operation
tgbot-cpp copied to clipboard

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

Open uralm1 opened this issue 1 year ago • 3 comments

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.

uralm1 avatar Nov 08 '24 11:11 uralm1

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

Royna2544 avatar Nov 13 '24 03:11 Royna2544

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

jsoncpp is promising. I have some notes out of this topic while adapting my bot code, can you open issues in your project?

uralm1 avatar Nov 13 '24 19:11 uralm1

sure, i didnt know it was closed, now it is open

Royna2544 avatar Nov 14 '24 01:11 Royna2544