Skip to content

Commit ffe77fb

Browse files
committed
Updates for Bot API 4.3.
1 parent db88019 commit ffe77fb

File tree

1 file changed

+56
-46
lines changed

1 file changed

+56
-46
lines changed

types.go

Lines changed: 56 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -134,52 +134,53 @@ func (c Chat) ChatConfig() ChatConfig {
134134
// Message is returned by almost every request, and contains data about
135135
// almost anything.
136136
type Message struct {
137-
MessageID int `json:"message_id"`
138-
From *User `json:"from"` // optional
139-
Date int `json:"date"`
140-
Chat *Chat `json:"chat"`
141-
ForwardFrom *User `json:"forward_from"` // optional
142-
ForwardFromChat *Chat `json:"forward_from_chat"` // optional
143-
ForwardFromMessageID int `json:"forward_from_message_id"` // optional
144-
ForwardSignature string `json:"forward_signature"` // optional
145-
ForwardSenderName string `json:"forward_sender_name"` // optional
146-
ForwardDate int `json:"forward_date"` // optional
147-
ReplyToMessage *Message `json:"reply_to_message"` // optional
148-
EditDate int `json:"edit_date"` // optional
149-
MediaGroupID string `json:"media_group_id"` // optional
150-
AuthorSignature string `json:"author_signature"` // optional
151-
Text string `json:"text"` // optional
152-
Entities []MessageEntity `json:"entities"` // optional
153-
CaptionEntities []MessageEntity `json:"caption_entities"` // optional
154-
Audio *Audio `json:"audio"` // optional
155-
Document *Document `json:"document"` // optional
156-
Animation *ChatAnimation `json:"animation"` // optional
157-
Game *Game `json:"game"` // optional
158-
Photo []PhotoSize `json:"photo"` // optional
159-
Sticker *Sticker `json:"sticker"` // optional
160-
Video *Video `json:"video"` // optional
161-
VideoNote *VideoNote `json:"video_note"` // optional
162-
Voice *Voice `json:"voice"` // optional
163-
Caption string `json:"caption"` // optional
164-
Contact *Contact `json:"contact"` // optional
165-
Location *Location `json:"location"` // optional
166-
Venue *Venue `json:"venue"` // optional
167-
Poll *Poll `json:"poll"` // optional
168-
NewChatMembers []User `json:"new_chat_members"` // optional
169-
LeftChatMember *User `json:"left_chat_member"` // optional
170-
NewChatTitle string `json:"new_chat_title"` // optional
171-
NewChatPhoto []PhotoSize `json:"new_chat_photo"` // optional
172-
DeleteChatPhoto bool `json:"delete_chat_photo"` // optional
173-
GroupChatCreated bool `json:"group_chat_created"` // optional
174-
SuperGroupChatCreated bool `json:"supergroup_chat_created"` // optional
175-
ChannelChatCreated bool `json:"channel_chat_created"` // optional
176-
MigrateToChatID int64 `json:"migrate_to_chat_id"` // optional
177-
MigrateFromChatID int64 `json:"migrate_from_chat_id"` // optional
178-
PinnedMessage *Message `json:"pinned_message"` // optional
179-
Invoice *Invoice `json:"invoice"` // optional
180-
SuccessfulPayment *SuccessfulPayment `json:"successful_payment"` // optional
181-
ConnectedWebsite string `json:"connected_website"` // optional
182-
PassportData *PassportData `json:"passport_data,omitempty"` // optional
137+
MessageID int `json:"message_id"`
138+
From *User `json:"from"` // optional
139+
Date int `json:"date"`
140+
Chat *Chat `json:"chat"`
141+
ForwardFrom *User `json:"forward_from"` // optional
142+
ForwardFromChat *Chat `json:"forward_from_chat"` // optional
143+
ForwardFromMessageID int `json:"forward_from_message_id"` // optional
144+
ForwardSignature string `json:"forward_signature"` // optional
145+
ForwardSenderName string `json:"forward_sender_name"` // optional
146+
ForwardDate int `json:"forward_date"` // optional
147+
ReplyToMessage *Message `json:"reply_to_message"` // optional
148+
EditDate int `json:"edit_date"` // optional
149+
MediaGroupID string `json:"media_group_id"` // optional
150+
AuthorSignature string `json:"author_signature"` // optional
151+
Text string `json:"text"` // optional
152+
Entities []MessageEntity `json:"entities"` // optional
153+
CaptionEntities []MessageEntity `json:"caption_entities"` // optional
154+
Audio *Audio `json:"audio"` // optional
155+
Document *Document `json:"document"` // optional
156+
Animation *ChatAnimation `json:"animation"` // optional
157+
Game *Game `json:"game"` // optional
158+
Photo []PhotoSize `json:"photo"` // optional
159+
Sticker *Sticker `json:"sticker"` // optional
160+
Video *Video `json:"video"` // optional
161+
VideoNote *VideoNote `json:"video_note"` // optional
162+
Voice *Voice `json:"voice"` // optional
163+
Caption string `json:"caption"` // optional
164+
Contact *Contact `json:"contact"` // optional
165+
Location *Location `json:"location"` // optional
166+
Venue *Venue `json:"venue"` // optional
167+
Poll *Poll `json:"poll"` // optional
168+
NewChatMembers []User `json:"new_chat_members"` // optional
169+
LeftChatMember *User `json:"left_chat_member"` // optional
170+
NewChatTitle string `json:"new_chat_title"` // optional
171+
NewChatPhoto []PhotoSize `json:"new_chat_photo"` // optional
172+
DeleteChatPhoto bool `json:"delete_chat_photo"` // optional
173+
GroupChatCreated bool `json:"group_chat_created"` // optional
174+
SuperGroupChatCreated bool `json:"supergroup_chat_created"` // optional
175+
ChannelChatCreated bool `json:"channel_chat_created"` // optional
176+
MigrateToChatID int64 `json:"migrate_to_chat_id"` // optional
177+
MigrateFromChatID int64 `json:"migrate_from_chat_id"` // optional
178+
PinnedMessage *Message `json:"pinned_message"` // optional
179+
Invoice *Invoice `json:"invoice"` // optional
180+
SuccessfulPayment *SuccessfulPayment `json:"successful_payment"` // optional
181+
ConnectedWebsite string `json:"connected_website"` // optional
182+
PassportData *PassportData `json:"passport_data,omitempty"` // optional
183+
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup"` // optional
183184
}
184185

185186
// Time converts the message timestamp into a Time.
@@ -464,13 +465,22 @@ type InlineKeyboardMarkup struct {
464465
type InlineKeyboardButton struct {
465466
Text string `json:"text"`
466467
URL *string `json:"url,omitempty"` // optional
468+
LoginURL *LoginURL `json:"login_url,omitempty"` // optional
467469
CallbackData *string `json:"callback_data,omitempty"` // optional
468470
SwitchInlineQuery *string `json:"switch_inline_query,omitempty"` // optional
469471
SwitchInlineQueryCurrentChat *string `json:"switch_inline_query_current_chat,omitempty"` // optional
470472
CallbackGame *CallbackGame `json:"callback_game,omitempty"` // optional
471473
Pay bool `json:"pay,omitempty"` // optional
472474
}
473475

476+
// LoginURL is the parameters for the login inline keyboard button type.
477+
type LoginURL struct {
478+
URL string `json:"url"`
479+
ForwardText string `json:"forward_text"`
480+
BotUsername string `json:"bot_username"`
481+
RequestWriteAccess bool `json:"request_write_access"`
482+
}
483+
474484
// CallbackQuery is data sent when a keyboard button with callback data
475485
// is clicked.
476486
type CallbackQuery struct {

0 commit comments

Comments
 (0)