diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-11 02:16:22 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-11 02:26:33 +0700 |
| commit | 4e1be518677a2c8d8bce6a33c72fb5e55f45e796 (patch) | |
| tree | 74b1374b6c54aecdf85815fd67ff5e04b6b0e15b /api/telegram/bot/inline_keyboard_button.go | |
| parent | b7f7a78f3acada26f83c27158b2306f631ec033b (diff) | |
| download | pakakeh.go-4e1be518677a2c8d8bce6a33c72fb5e55f45e796.tar.xz | |
api/telegram/bot: realign struct for better size allocation
The realignment reduce the size of the following struct (in bytes),
* Audio: from 112 to 104 (-8)
* Bot: from 88 to 72 (-16)
* Chat: from 160 to 144 (-16)
* Command: from 40 to 32 (-8)
* struct in TestCommand_validate: from 72 to 64 (-8)
* Contact: from 64 to 56 (-8)
* Document: from 80 to 64 (-16)
* EncryptedPassportElement: from 144 to 136 (-8)
* Game: from 104 to 88 (-16)
* InlineKeyboardButton: from 96 to 88 (-8)
* InlineQuery: from 64 to 56 (-8)
* Message: from 544 to 488 (-56)
* MessageEntity: from 64 to 48 (-16)
* MessageForward: from 56 to 40 (-16)
* messageRequest: from 80 to 56 (-24)
* struct in TestMessage_parseCommandArgs: from 576 to 520 (-36)
* Options: from 32 to 24 (-8)
* OrderInfo: from 56 to 48 (-8)
* PassportData: from 64 to 56 (-8)
* PreCheckoutQuery: from 88 to 72 (-16)
* response: from 56 to 32 (-24)
* ShippingQuery: from 48 to 40 (-8)
* Sticker: from 136 to 112 (-24)
* SuccessfulPayment: from 88 to 80 (-8)
* Update: from 96 to 88 (-8)
* User: from 64 to 56 (-8)
* Venue: from 72 to 56 (-16)
* Webhook: from 96 to 72 (-16)
* WebhookInfo: from 64 to 40 (-24)
Diffstat (limited to 'api/telegram/bot/inline_keyboard_button.go')
| -rw-r--r-- | api/telegram/bot/inline_keyboard_button.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/api/telegram/bot/inline_keyboard_button.go b/api/telegram/bot/inline_keyboard_button.go index 755f3670..3b6fcfca 100644 --- a/api/telegram/bot/inline_keyboard_button.go +++ b/api/telegram/bot/inline_keyboard_button.go @@ -7,16 +7,23 @@ package bot // InlineKeyboardButton represents one button of an inline keyboard. You must // use exactly one of the optional fields. type InlineKeyboardButton struct { + // Optional. An HTTP URL used to automatically authorize the user. Can + // be used as a replacement for the Telegram Login Widget. + LoginURL *LoginURL `json:"login_url"` + + // Optional. Description of the game that will be launched when the + // user presses the button. + // + // NOTE: This type of button must always be the first button in the + // first row. + CallbackGame *CallbackGame `json:"callback_game"` + // Label text on the button. Text string `json:"text"` // Optional. HTTP or tg:// url to be opened when button is pressed. URL string `json:"url"` - // Optional. An HTTP URL used to automatically authorize the user. Can - // be used as a replacement for the Telegram Login Widget. - LoginURL *LoginURL `json:"login_url"` - // Optional. Data to be sent in a callback query to the bot when // button is pressed, 1-64 bytes. CallbackData string `json:"callback_data"` @@ -33,13 +40,6 @@ type InlineKeyboardButton struct { // inserted. SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat"` - // Optional. Description of the game that will be launched when the - // user presses the button. - // - // NOTE: This type of button must always be the first button in the - // first row. - CallbackGame *CallbackGame `json:"callback_game"` - // Optional. Specify True, to send a Pay button. // // NOTE: This type of button must always be the first button in the |
