MajMcCloud / TelegramBotFramework

This is a context based application framework for the C# TelegramBot library.
https://www.t.me/tgbotbase
MIT License
149 stars 43 forks source link

Call Serialize implicitly when assigning to a string #34

Closed alex6dj closed 1 year ago

alex6dj commented 1 year ago

Every time a ButtonBase is instantiated and CallbackData get used as a Value for it, .Serialize() need to be called because Value only accept an string.

So with this instead of:

var new button = new ButtonBase("Edit", new CallbackData("a", CallbackValues.Name).Serialize());

Now you can do:

var new button = new ButtonBase("Edit", new CallbackData("a", CallbackValues.Name));

So no more .Serialize() call.

MajMcCloud commented 1 year ago

Added for ease of use for the CallBackData structure. Thanks for the PR and commit 👍