|
|
|
@ -50,40 +50,41 @@ type GroupChat struct { |
|
|
|
|
Title string `json:"title"` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UserOrGroupChat is returned in Message, because it's not clear which it is.
|
|
|
|
|
type UserOrGroupChat struct { |
|
|
|
|
// Chat is returned in Message, it contains information about the Chat a message was sent in.
|
|
|
|
|
type Chat struct { |
|
|
|
|
ID int `json:"id"` |
|
|
|
|
Type string `json:"type"` |
|
|
|
|
Title string `json:"title"` |
|
|
|
|
UserName string `json:"username"` |
|
|
|
|
FirstName string `json:"first_name"` |
|
|
|
|
LastName string `json:"last_name"` |
|
|
|
|
UserName string `json:"username"` |
|
|
|
|
Title string `json:"title"` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Message is returned by almost every request, and contains data about almost anything.
|
|
|
|
|
type Message struct { |
|
|
|
|
MessageID int `json:"message_id"` |
|
|
|
|
From User `json:"from"` |
|
|
|
|
Date int `json:"date"` |
|
|
|
|
Chat UserOrGroupChat `json:"chat"` |
|
|
|
|
ForwardFrom User `json:"forward_from"` |
|
|
|
|
ForwardDate int `json:"forward_date"` |
|
|
|
|
ReplyToMessage *Message `json:"reply_to_message"` |
|
|
|
|
Text string `json:"text"` |
|
|
|
|
Audio Audio `json:"audio"` |
|
|
|
|
Document Document `json:"document"` |
|
|
|
|
Photo []PhotoSize `json:"photo"` |
|
|
|
|
Sticker Sticker `json:"sticker"` |
|
|
|
|
Video Video `json:"video"` |
|
|
|
|
Voice Voice `json:"voice"` |
|
|
|
|
Caption string `json:"caption"` |
|
|
|
|
Contact Contact `json:"contact"` |
|
|
|
|
Location Location `json:"location"` |
|
|
|
|
NewChatParticipant User `json:"new_chat_participant"` |
|
|
|
|
LeftChatParticipant User `json:"left_chat_participant"` |
|
|
|
|
NewChatTitle string `json:"new_chat_title"` |
|
|
|
|
NewChatPhoto []PhotoSize `json:"new_chat_photo"` |
|
|
|
|
DeleteChatPhoto bool `json:"delete_chat_photo"` |
|
|
|
|
GroupChatCreated bool `json:"group_chat_created"` |
|
|
|
|
MessageID int `json:"message_id"` |
|
|
|
|
From User `json:"from"` |
|
|
|
|
Date int `json:"date"` |
|
|
|
|
Chat Chat `json:"chat"` |
|
|
|
|
ForwardFrom User `json:"forward_from"` |
|
|
|
|
ForwardDate int `json:"forward_date"` |
|
|
|
|
ReplyToMessage *Message `json:"reply_to_message"` |
|
|
|
|
Text string `json:"text"` |
|
|
|
|
Audio Audio `json:"audio"` |
|
|
|
|
Document Document `json:"document"` |
|
|
|
|
Photo []PhotoSize `json:"photo"` |
|
|
|
|
Sticker Sticker `json:"sticker"` |
|
|
|
|
Video Video `json:"video"` |
|
|
|
|
Voice Voice `json:"voice"` |
|
|
|
|
Caption string `json:"caption"` |
|
|
|
|
Contact Contact `json:"contact"` |
|
|
|
|
Location Location `json:"location"` |
|
|
|
|
NewChatParticipant User `json:"new_chat_participant"` |
|
|
|
|
LeftChatParticipant User `json:"left_chat_participant"` |
|
|
|
|
NewChatTitle string `json:"new_chat_title"` |
|
|
|
|
NewChatPhoto []PhotoSize `json:"new_chat_photo"` |
|
|
|
|
DeleteChatPhoto bool `json:"delete_chat_photo"` |
|
|
|
|
GroupChatCreated bool `json:"group_chat_created"` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Time converts the message timestamp into a Time.
|
|
|
|
|