/
mediaObjects.go
184 lines (160 loc) 路 6.15 KB
/
mediaObjects.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
package objects
type MessageEntity struct {
Type string `json:"type"`
Offset int `json:"offset"`
Length int `json:"length"`
URL string `json:"url,omitempty"`
User *User `json:"user,omitempty"`
Language string `json:"language,omitempty"`
CustomEmojiId string `json:"custom_emoji_id"`
}
type PhotoSize struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Width int `json:"width"`
Height int `json:"height"`
FileSize int `json:"file_size,omitempty"`
}
type Animation struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Width int `json:"width"`
Height int `json:"height"`
Duration int `json:"duration"`
Thumb *PhotoSize `json:"thumbnail,omitempty"`
FileName string `json:"file_name,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
type Audio struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Duration int `json:"duration"`
Performer string `json:"performer,omitempty"`
Title string `json:"title,omitempty"`
FileName string `json:"file_name,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
Thumb *PhotoSize `json:"thumbnail,omitempty"`
}
type Document struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Thumb *PhotoSize `json:"thumbnail,omitempty"`
FileName string `json:"file_name,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
type Video struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Width int `json:"width"`
Height int `json:"height"`
Duration int `json:"duration"`
Thumb *PhotoSize `json:"thumbnail,omitempty"`
FileName string `json:"file_name,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
type VideoNote struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Length int `json:"length"`
Duration int `json:"duration"`
Thumb *PhotoSize `json:"thumbnail,omitempty"`
FileSize int `json:"file_size,omitempty"`
}
type Voice struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
Duration int `json:"duration"`
MIMEType string `json:"mime_type,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
type Contact struct {
PhoneNumber string `json:"phone_number"`
FirstName string `json:"first_name"`
LastName string `json:"last_name,omitempty"`
UserId int `json:"user_id,omitempty"`
Vcard string `json:"vcard,omitempty"`
}
type Dice struct {
Emoji string `json:"emoji"`
Value int `json:"value"`
}
type PollOption struct {
Text string `json:"text"`
VoterCount int `json:"voter_count"`
}
type PollAnswer struct {
//Unique poll identifier
PollId string `json:"poll_id"`
//Optional. The chat that changed the answer to the poll, if the voter is anonymous
VoterChat *Chat `json:"voter_chat"`
/*Optional. The user that changed the answer to the poll, if the voter isn't anonymous
For backward compatibility, the field user in such objects will contain the user 136817688.
*/
User *User `json:"user"`
//0-based identifiers of chosen answer options. May be empty if the vote was retracted.
OptionIds []int `json:"option_ids"`
}
type Poll struct {
Id string `json:"id"`
Question string `json:"question"`
Options []PollOption `json:"options"`
TotalVoterCount int `json:"total_voter_count"`
IsClosed bool `json:"is_closed"`
IsAnonymous bool `json:"is_anonymous"`
Type string `json:"type"`
AllowsMultipleAnswers bool `json:"allows_multiple_answers"`
CorrectOptionId int `json:"correct_option_id,omitempty"`
Explanation string `json:"explanation,omitempty"`
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
OpenPeriod int `json:"open_period,omitempty"`
CloseDate int `json:"close_date,omitempty"`
}
type Location struct {
Longitude float32 `json:"longitude"`
Latitude float32 `json:"Latitude"`
HorizontalAccuracy float32 `json:"horizontal_accuracy,omitempty"`
LivePeriod int `json:"live_period,omitempty"`
Heading int `json:"heading,omitempty"`
ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
}
type Venue struct {
Location *Location `json:"location"`
Title string `json:"title"`
Address string `json:"address"`
FoursquareId string `json:"foursquare_id,omitempty"`
FoursquareType string `json:"foursquare_type,omitempty"`
GooglePlaceId string `json:"google_place_id,omitempty"`
GooglePlaceType string `json:"google_place_type,omitempty"`
}
type ProximityAlertTriggered struct {
Traveler *User `json:"traveer"`
Watcher *User `json:"Watcher"`
Distance int `json:"distance"`
}
type MessageAutoDeleteTimerChanged struct {
MessageAutoDeleteTime int `json:"message_auto_delete_time"`
}
type VideoChatScheduled struct {
StartDate int `json:"start_date"`
}
type VideoChatStarted struct{}
type VideoChatEnded struct {
Duration int `json:"duration"`
}
type VideoChatParticipantsInvited struct {
Users []User `json:"users"`
}
type UserProfilePhotos struct {
TotalCount int `json:"total_count"`
Photos [][]PhotoSize `json:"photos"`
}
type File struct {
FileId string `json:"file_id"`
FileUniqueId string `json:"file_unique_id"`
FileSize int64 `json:"file_size,omitempty"`
FilePath string `json:"file_path,omitempty"`
}