PaulSonOfLars / gotgbot

Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
MIT License
442 stars 105 forks source link

"From" is not a pointer type in all but Message structs #168

Closed svscorp closed 3 weeks ago

svscorp commented 3 weeks ago

in gen_types.go

The struct Message has From *Userjson:"from,omitempty"``

However the struct CallbackQuery has From Userjson:"from"``

Is there a reason to not have "From" as a pointer type in CallbackQuery (and other than Message queries)?

PaulSonOfLars commented 3 weeks ago

Remember that the library is autogenerated from the docs. So if a field is a pointer, it's because it is optional, and may be empty. CallbackQueries HAVE to be initiated by a user; someone pressed a button; so From cannot be nil. See: https://core.telegram.org/bots/api#callbackquery