forked from SevereCloud/vksdk
/
handler.go
376 lines (292 loc) · 11.4 KB
/
handler.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
package object // import "github.com/akss1/vksdk/5.92/object"
// MessageNewFunc func
type MessageNewFunc func(MessageNewObject, int)
// MessageNewObject struct
type MessageNewObject MessagesMessage
// MessageReplyFunc func
type MessageReplyFunc func(MessageReplyObject, int)
// MessageReplyObject struct
type MessageReplyObject MessagesMessage
// MessageEditFunc func
type MessageEditFunc func(MessageEditObject, int)
// MessageEditObject struct
type MessageEditObject MessagesMessage
// MessageAllowFunc func
type MessageAllowFunc func(MessageAllowObject, int)
// MessageAllowObject struct
type MessageAllowObject struct {
UserID int `json:"user_id"`
Key string `json:"key"`
}
// MessageDenyFunc func
type MessageDenyFunc func(MessageDenyObject, int)
// MessageDenyObject struct
type MessageDenyObject struct {
UserID int `json:"user_id"`
}
// MessageTypingStateFunc func
type MessageTypingStateFunc func(MessageTypingStateObject, int)
// MessageTypingStateObject struct
type MessageTypingStateObject struct {
State string `json:"state"`
FromID int `json:"from_id"`
ToID int `json:"to_id"`
}
// PhotoNewFunc func
type PhotoNewFunc func(PhotoNewObject, int)
// PhotoNewObject struct
type PhotoNewObject PhotosPhoto
// PhotoCommentNewFunc func
type PhotoCommentNewFunc func(PhotoCommentNewObject, int)
// PhotoCommentNewObject struct
type PhotoCommentNewObject WallWallComment
// PhotoCommentEditFunc func
type PhotoCommentEditFunc func(PhotoCommentEditObject, int)
// PhotoCommentEditObject struct
type PhotoCommentEditObject WallWallComment
// PhotoCommentRestoreFunc func
type PhotoCommentRestoreFunc func(PhotoCommentRestoreObject, int)
// PhotoCommentRestoreObject struct
type PhotoCommentRestoreObject WallWallComment
// PhotoCommentDeleteFunc func
type PhotoCommentDeleteFunc func(PhotoCommentDeleteObject, int)
// PhotoCommentDeleteObject struct
type PhotoCommentDeleteObject struct {
OwnerID int `json:"owner_id"`
ID int `json:"id"`
UserID int `json:"user_id"`
DeleterID int `json:"deleter_id"`
PhotoID int `json:"photo_id"`
}
// AudioNewFunc func
type AudioNewFunc func(AudioNewObject, int)
// AudioNewObject struct
type AudioNewObject AudioAudioFull
// VideoNewFunc func
type VideoNewFunc func(VideoNewObject, int)
// VideoNewObject struct
type VideoNewObject VideoVideo
// VideoCommentNewFunc func
type VideoCommentNewFunc func(VideoCommentNewObject, int)
// VideoCommentNewObject struct
type VideoCommentNewObject WallWallComment
// VideoCommentEditFunc func
type VideoCommentEditFunc func(VideoCommentEditObject, int)
// VideoCommentEditObject struct
type VideoCommentEditObject WallWallComment
// VideoCommentRestoreFunc func
type VideoCommentRestoreFunc func(VideoCommentRestoreObject, int)
// VideoCommentRestoreObject struct
type VideoCommentRestoreObject WallWallComment
// VideoCommentDeleteFunc func
type VideoCommentDeleteFunc func(VideoCommentDeleteObject, int)
// VideoCommentDeleteObject struct
type VideoCommentDeleteObject struct {
OwnerID int `json:"owner_id"`
ID int `json:"id"`
UserID int `json:"user_id"`
DeleterID int `json:"deleter_id"`
VideoID int `json:"video_id"`
}
// WallPostNewFunc func
type WallPostNewFunc func(WallPostNewObject, int)
// WallPostNewObject struct
type WallPostNewObject WallWallpost
// WallRepostFunc func
type WallRepostFunc func(WallRepostObject, int)
// WallRepostObject struct
type WallRepostObject WallWallpost
// WallReplyNewFunc func
type WallReplyNewFunc func(WallReplyNewObject, int)
// WallReplyNewObject struct
type WallReplyNewObject WallWallComment
// WallReplyEditFunc func
type WallReplyEditFunc func(WallReplyEditObject, int)
// WallReplyEditObject struct
type WallReplyEditObject WallWallComment
// WallReplyRestoreFunc func
type WallReplyRestoreFunc func(WallReplyRestoreObject, int)
// WallReplyRestoreObject struct
type WallReplyRestoreObject WallWallComment
// WallReplyDeleteFunc func
type WallReplyDeleteFunc func(WallReplyDeleteObject, int)
// WallReplyDeleteObject struct
type WallReplyDeleteObject struct {
OwnerID int `json:"owner_id"`
ID int `json:"id"`
DeleterID int `json:"deleter_id"`
PostID int `json:"post_id"`
}
// BoardPostNewFunc func
type BoardPostNewFunc func(BoardPostNewObject, int)
// BoardPostNewObject struct
type BoardPostNewObject BoardTopicComment
// BoardPostEditFunc func
type BoardPostEditFunc func(BoardPostEditObject, int)
// BoardPostEditObject struct
type BoardPostEditObject BoardTopicComment
// BoardPostRestoreFunc func
type BoardPostRestoreFunc func(BoardPostRestoreObject, int)
// BoardPostRestoreObject struct
type BoardPostRestoreObject BoardTopicComment
// BoardPostDeleteFunc func
type BoardPostDeleteFunc func(BoardPostDeleteObject, int)
// BoardPostDeleteObject struct
type BoardPostDeleteObject struct {
TopicOwnerID int `json:"topic_owner_id"`
TopicID int `json:"topic_id"`
ID int `json:"id"`
}
// MarketCommentNewFunc func
type MarketCommentNewFunc func(MarketCommentNewObject, int)
// MarketCommentNewObject struct
type MarketCommentNewObject WallWallComment
// MarketCommentEditFunc func
type MarketCommentEditFunc func(MarketCommentEditObject, int)
// MarketCommentEditObject struct
type MarketCommentEditObject WallWallComment
// MarketCommentRestoreFunc func
type MarketCommentRestoreFunc func(MarketCommentRestoreObject, int)
// MarketCommentRestoreObject struct
type MarketCommentRestoreObject WallWallComment
// MarketCommentDeleteFunc func
type MarketCommentDeleteFunc func(MarketCommentDeleteObject, int)
// MarketCommentDeleteObject struct
type MarketCommentDeleteObject struct {
OwnerID int `json:"owner_id"`
ID int `json:"id"`
UserID int `json:"user_id"`
DeleterID int `json:"deleter_id"`
ItemID int `json:"item_id"`
}
// GroupLeaveFunc func
type GroupLeaveFunc func(GroupLeaveObject, int)
// GroupLeaveObject struct
type GroupLeaveObject struct {
UserID int `json:"user_id"`
Self int `json:"self"`
}
// GroupJoinFunc func
type GroupJoinFunc func(GroupJoinObject, int)
// GroupJoinObject struct
type GroupJoinObject struct {
UserID int `json:"user_id"`
JoinType string `json:"join_type"`
}
// UserBlockFunc func
type UserBlockFunc func(UserBlockObject, int)
// UserBlockObject struct
type UserBlockObject struct {
AdminID int `json:"admin_id"`
UserID int `json:"user_id"`
UnblockDate int `json:"unblock_date"`
Reason int `json:"reason"`
Comment string `json:"comment"`
}
// UserUnblockFunc func
type UserUnblockFunc func(UserUnblockObject, int)
// UserUnblockObject struct
type UserUnblockObject struct {
AdminID int `json:"admin_id"`
UserID int `json:"user_id"`
ByEndDate int `json:"by_end_date"`
}
// PollVoteNewFunc func
type PollVoteNewFunc func(PollVoteNewObject, int)
// PollVoteNewObject struct
// BUG(VK): при голосовании за несколько вариантов, возвращается только один
type PollVoteNewObject struct {
OwnerID int `json:"owner_id"`
PollID int `json:"poll_id"`
OptionID int `json:"option_id"`
UserID int `json:"user_id"`
}
// GroupOfficersEditFunc func
type GroupOfficersEditFunc func(GroupOfficersEditObject, int)
// GroupOfficersEditObject struct
type GroupOfficersEditObject struct {
AdminID int `json:"admin_id"`
UserID int `json:"user_id"`
LevelOld int `json:"level_old"`
LevelNew int `json:"level_new"`
}
type changes struct {
OldValue string `json:"old_value"`
NewValue string `json:"new_value"`
}
type changesInt struct {
OldValue int `json:"old_value"`
NewValue int `json:"new_value"`
}
// GroupChangeSettingsFunc func
type GroupChangeSettingsFunc func(GroupChangeSettingsObject, int)
// GroupChangeSettingsObject struct
// спасибо vk.com/eee
// BUG(VK): Phone https://vk.com/bugtracker?act=show&id=64240
// BUG(VK): Email https://vk.com/bugtracker?act=show&id=86650
type GroupChangeSettingsObject struct {
UserID int `json:"user_id"`
Changes struct {
Title changes `json:"title"`
Description changes `json:"description"`
Access changesInt `json:"access"`
ScreenName changes `json:"screen_name"`
PublicCategory changesInt `json:"public_category"`
PublicSubcategory changesInt `json:"public_subcategory"`
AgeLimits changesInt `json:"age_limits"`
Website changes `json:"website"`
StatusDefault changes `json:"status_default"`
Wall changesInt `json:"wall"` // на основе ответа
Replies changesInt `json:"replies"` // на основе ответа
Topics changesInt `json:"topics"` // на основе ответа
Audio changesInt `json:"audio"` // на основе ответа
Photos changesInt `json:"photos"` // на основе ответа
Video changesInt `json:"video"` // на основе ответа
Market changesInt `json:"market"` // на основе ответа
Docs changesInt `json:"docs"` // на основе ответа
Messages changesInt `json:"messages"` // на основе ответа
EventGroupID changesInt `json:"event_group_id"` // на основе ответа
Links changes `json:"links"` // на основе ответа
Email changes `json:"email"` // на основе ответа
EventStartDate changesInt `json:"event_start_date::"` // на основе ответа
EventFinishDate changesInt `json:"event_finish_date:"` // на основе ответа
Subject changes `json:"subject"` // на основе ответа
MarketWiki changes `json:"market_wiki"` // на основе ответа
DisableMarketComments changesInt `json:"disable_market_comments"` // на основе ответа
Phone changesInt `json:"phone"` // на основе ответа
CountryID changesInt `json:"country_id"` // на основе ответа
CityID changesInt `json:"city_id"` // на основе ответа
} `json:"changes"`
}
// GroupChangePhotoFunc func
type GroupChangePhotoFunc func(GroupChangePhotoObject, int)
// GroupChangePhotoObject struct
type GroupChangePhotoObject struct {
UserID int `json:"user_id"`
Photo PhotosPhoto `json:"photo"`
}
// VkpayTransactionFunc func
type VkpayTransactionFunc func(VkpayTransactionObject, int)
// VkpayTransactionObject struct
type VkpayTransactionObject struct {
FromID int `json:"from_id"`
Amount string `json:"amount"` // FIXME: string or int?
Description string `json:"description"`
Date string `json:"date"` // FIXME: string or int?
}
// LeadFormsNewFunc func
type LeadFormsNewFunc func(LeadFormsNewObject, int)
// LeadFormsNewObject struct
type LeadFormsNewObject struct {
LeadID int `json:"lead_id"`
GroupID int `json:"group_id"`
UserID int `json:"user_id"`
FormID int `json:"form_id"`
FormName string `json:"form_name"`
AdID int `json:"ad_id"`
Answers []struct {
Key string `json:"key"`
Question string `json:"question"`
Answer string `json:"answer"`
} `json:"answers"`
}