-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathgen_helpers.go
executable file
·528 lines (423 loc) · 17.1 KB
/
gen_helpers.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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
// Regen by running 'go generate' in the repo root.
package gotgbot
// Get Helper method for Bot.GetBusinessConnection.
func (bc BusinessConnection) Get(b *Bot, opts *GetBusinessConnectionOpts) (*BusinessConnection, error) {
return b.GetBusinessConnection(bc.Id, opts)
}
// Answer Helper method for Bot.AnswerCallbackQuery.
func (cq CallbackQuery) Answer(b *Bot, opts *AnswerCallbackQueryOpts) (bool, error) {
return b.AnswerCallbackQuery(cq.Id, opts)
}
// ApproveJoinRequest Helper method for Bot.ApproveChatJoinRequest.
func (c Chat) ApproveJoinRequest(b *Bot, userId int64, opts *ApproveChatJoinRequestOpts) (bool, error) {
return b.ApproveChatJoinRequest(c.Id, userId, opts)
}
// BanMember Helper method for Bot.BanChatMember.
func (c Chat) BanMember(b *Bot, userId int64, opts *BanChatMemberOpts) (bool, error) {
return b.BanChatMember(c.Id, userId, opts)
}
// BanSenderChat Helper method for Bot.BanChatSenderChat.
func (c Chat) BanSenderChat(b *Bot, senderChatId int64, opts *BanChatSenderChatOpts) (bool, error) {
return b.BanChatSenderChat(c.Id, senderChatId, opts)
}
// CreateInviteLink Helper method for Bot.CreateChatInviteLink.
func (c Chat) CreateInviteLink(b *Bot, opts *CreateChatInviteLinkOpts) (*ChatInviteLink, error) {
return b.CreateChatInviteLink(c.Id, opts)
}
// CreateSubscriptionInviteLink Helper method for Bot.CreateChatSubscriptionInviteLink.
func (c Chat) CreateSubscriptionInviteLink(b *Bot, subscriptionPeriod int64, subscriptionPrice int64, opts *CreateChatSubscriptionInviteLinkOpts) (*ChatInviteLink, error) {
return b.CreateChatSubscriptionInviteLink(c.Id, subscriptionPeriod, subscriptionPrice, opts)
}
// DeclineJoinRequest Helper method for Bot.DeclineChatJoinRequest.
func (c Chat) DeclineJoinRequest(b *Bot, userId int64, opts *DeclineChatJoinRequestOpts) (bool, error) {
return b.DeclineChatJoinRequest(c.Id, userId, opts)
}
// DeletePhoto Helper method for Bot.DeleteChatPhoto.
func (c Chat) DeletePhoto(b *Bot, opts *DeleteChatPhotoOpts) (bool, error) {
return b.DeleteChatPhoto(c.Id, opts)
}
// DeleteStickerSet Helper method for Bot.DeleteChatStickerSet.
func (c Chat) DeleteStickerSet(b *Bot, opts *DeleteChatStickerSetOpts) (bool, error) {
return b.DeleteChatStickerSet(c.Id, opts)
}
// EditInviteLink Helper method for Bot.EditChatInviteLink.
func (c Chat) EditInviteLink(b *Bot, inviteLink string, opts *EditChatInviteLinkOpts) (*ChatInviteLink, error) {
return b.EditChatInviteLink(c.Id, inviteLink, opts)
}
// EditSubscriptionInviteLink Helper method for Bot.EditChatSubscriptionInviteLink.
func (c Chat) EditSubscriptionInviteLink(b *Bot, inviteLink string, opts *EditChatSubscriptionInviteLinkOpts) (*ChatInviteLink, error) {
return b.EditChatSubscriptionInviteLink(c.Id, inviteLink, opts)
}
// ExportInviteLink Helper method for Bot.ExportChatInviteLink.
func (c Chat) ExportInviteLink(b *Bot, opts *ExportChatInviteLinkOpts) (string, error) {
return b.ExportChatInviteLink(c.Id, opts)
}
// Get Helper method for Bot.GetChat.
func (c Chat) Get(b *Bot, opts *GetChatOpts) (*ChatFullInfo, error) {
return b.GetChat(c.Id, opts)
}
// GetAdministrators Helper method for Bot.GetChatAdministrators.
func (c Chat) GetAdministrators(b *Bot, opts *GetChatAdministratorsOpts) ([]ChatMember, error) {
return b.GetChatAdministrators(c.Id, opts)
}
// GetMember Helper method for Bot.GetChatMember.
func (c Chat) GetMember(b *Bot, userId int64, opts *GetChatMemberOpts) (ChatMember, error) {
return b.GetChatMember(c.Id, userId, opts)
}
// GetMemberCount Helper method for Bot.GetChatMemberCount.
func (c Chat) GetMemberCount(b *Bot, opts *GetChatMemberCountOpts) (int64, error) {
return b.GetChatMemberCount(c.Id, opts)
}
// GetMenuButton Helper method for Bot.GetChatMenuButton.
func (c Chat) GetMenuButton(b *Bot, opts *GetChatMenuButtonOpts) (MenuButton, error) {
if opts == nil {
opts = &GetChatMenuButtonOpts{}
}
if opts.ChatId == nil {
opts.ChatId = &c.Id
}
return b.GetChatMenuButton(opts)
}
// GetUserBoosts Helper method for Bot.GetUserChatBoosts.
func (c Chat) GetUserBoosts(b *Bot, userId int64, opts *GetUserChatBoostsOpts) (*UserChatBoosts, error) {
return b.GetUserChatBoosts(c.Id, userId, opts)
}
// Leave Helper method for Bot.LeaveChat.
func (c Chat) Leave(b *Bot, opts *LeaveChatOpts) (bool, error) {
return b.LeaveChat(c.Id, opts)
}
// PinMessage Helper method for Bot.PinChatMessage.
func (c Chat) PinMessage(b *Bot, messageId int64, opts *PinChatMessageOpts) (bool, error) {
return b.PinChatMessage(c.Id, messageId, opts)
}
// PromoteMember Helper method for Bot.PromoteChatMember.
func (c Chat) PromoteMember(b *Bot, userId int64, opts *PromoteChatMemberOpts) (bool, error) {
return b.PromoteChatMember(c.Id, userId, opts)
}
// RemoveVerification Helper method for Bot.RemoveChatVerification.
func (c Chat) RemoveVerification(b *Bot, opts *RemoveChatVerificationOpts) (bool, error) {
return b.RemoveChatVerification(c.Id, opts)
}
// RestrictMember Helper method for Bot.RestrictChatMember.
func (c Chat) RestrictMember(b *Bot, userId int64, permissions ChatPermissions, opts *RestrictChatMemberOpts) (bool, error) {
return b.RestrictChatMember(c.Id, userId, permissions, opts)
}
// RevokeInviteLink Helper method for Bot.RevokeChatInviteLink.
func (c Chat) RevokeInviteLink(b *Bot, inviteLink string, opts *RevokeChatInviteLinkOpts) (*ChatInviteLink, error) {
return b.RevokeChatInviteLink(c.Id, inviteLink, opts)
}
// SendAction Helper method for Bot.SendChatAction.
func (c Chat) SendAction(b *Bot, action string, opts *SendChatActionOpts) (bool, error) {
return b.SendChatAction(c.Id, action, opts)
}
// SetAdministratorCustomTitle Helper method for Bot.SetChatAdministratorCustomTitle.
func (c Chat) SetAdministratorCustomTitle(b *Bot, userId int64, customTitle string, opts *SetChatAdministratorCustomTitleOpts) (bool, error) {
return b.SetChatAdministratorCustomTitle(c.Id, userId, customTitle, opts)
}
// SetDescription Helper method for Bot.SetChatDescription.
func (c Chat) SetDescription(b *Bot, opts *SetChatDescriptionOpts) (bool, error) {
return b.SetChatDescription(c.Id, opts)
}
// SetMenuButton Helper method for Bot.SetChatMenuButton.
func (c Chat) SetMenuButton(b *Bot, opts *SetChatMenuButtonOpts) (bool, error) {
if opts == nil {
opts = &SetChatMenuButtonOpts{}
}
if opts.ChatId == nil {
opts.ChatId = &c.Id
}
return b.SetChatMenuButton(opts)
}
// SetPermissions Helper method for Bot.SetChatPermissions.
func (c Chat) SetPermissions(b *Bot, permissions ChatPermissions, opts *SetChatPermissionsOpts) (bool, error) {
return b.SetChatPermissions(c.Id, permissions, opts)
}
// SetPhoto Helper method for Bot.SetChatPhoto.
func (c Chat) SetPhoto(b *Bot, photo InputFile, opts *SetChatPhotoOpts) (bool, error) {
return b.SetChatPhoto(c.Id, photo, opts)
}
// SetStickerSet Helper method for Bot.SetChatStickerSet.
func (c Chat) SetStickerSet(b *Bot, stickerSetName string, opts *SetChatStickerSetOpts) (bool, error) {
return b.SetChatStickerSet(c.Id, stickerSetName, opts)
}
// SetTitle Helper method for Bot.SetChatTitle.
func (c Chat) SetTitle(b *Bot, title string, opts *SetChatTitleOpts) (bool, error) {
return b.SetChatTitle(c.Id, title, opts)
}
// UnbanMember Helper method for Bot.UnbanChatMember.
func (c Chat) UnbanMember(b *Bot, userId int64, opts *UnbanChatMemberOpts) (bool, error) {
return b.UnbanChatMember(c.Id, userId, opts)
}
// UnbanSenderChat Helper method for Bot.UnbanChatSenderChat.
func (c Chat) UnbanSenderChat(b *Bot, senderChatId int64, opts *UnbanChatSenderChatOpts) (bool, error) {
return b.UnbanChatSenderChat(c.Id, senderChatId, opts)
}
// UnpinAllMessages Helper method for Bot.UnpinAllChatMessages.
func (c Chat) UnpinAllMessages(b *Bot, opts *UnpinAllChatMessagesOpts) (bool, error) {
return b.UnpinAllChatMessages(c.Id, opts)
}
// UnpinMessage Helper method for Bot.UnpinChatMessage.
func (c Chat) UnpinMessage(b *Bot, opts *UnpinChatMessageOpts) (bool, error) {
return b.UnpinChatMessage(c.Id, opts)
}
// Verify Helper method for Bot.VerifyChat.
func (c Chat) Verify(b *Bot, opts *VerifyChatOpts) (bool, error) {
return b.VerifyChat(c.Id, opts)
}
// Send Helper method for Bot.SendGift.
func (g Gift) Send(b *Bot, userId int64, opts *SendGiftOpts) (bool, error) {
return b.SendGift(userId, g.Id, opts)
}
// Copy Helper method for Bot.CopyMessage.
func (im InaccessibleMessage) Copy(b *Bot, chatId int64, opts *CopyMessageOpts) (*MessageId, error) {
return b.CopyMessage(chatId, im.Chat.Id, im.MessageId, opts)
}
// Delete Helper method for Bot.DeleteMessage.
func (im InaccessibleMessage) Delete(b *Bot, opts *DeleteMessageOpts) (bool, error) {
return b.DeleteMessage(im.Chat.Id, im.MessageId, opts)
}
// EditCaption Helper method for Bot.EditMessageCaption.
func (im InaccessibleMessage) EditCaption(b *Bot, opts *EditMessageCaptionOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageCaptionOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = im.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = im.MessageId
}
return b.EditMessageCaption(opts)
}
// EditLiveLocation Helper method for Bot.EditMessageLiveLocation.
func (im InaccessibleMessage) EditLiveLocation(b *Bot, latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageLiveLocationOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = im.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = im.MessageId
}
return b.EditMessageLiveLocation(latitude, longitude, opts)
}
// EditMedia Helper method for Bot.EditMessageMedia.
func (im InaccessibleMessage) EditMedia(b *Bot, media InputMedia, opts *EditMessageMediaOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageMediaOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = im.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = im.MessageId
}
return b.EditMessageMedia(media, opts)
}
// EditReplyMarkup Helper method for Bot.EditMessageReplyMarkup.
func (im InaccessibleMessage) EditReplyMarkup(b *Bot, opts *EditMessageReplyMarkupOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageReplyMarkupOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = im.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = im.MessageId
}
return b.EditMessageReplyMarkup(opts)
}
// EditText Helper method for Bot.EditMessageText.
func (im InaccessibleMessage) EditText(b *Bot, text string, opts *EditMessageTextOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageTextOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = im.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = im.MessageId
}
return b.EditMessageText(text, opts)
}
// Forward Helper method for Bot.ForwardMessage.
func (im InaccessibleMessage) Forward(b *Bot, chatId int64, opts *ForwardMessageOpts) (*Message, error) {
return b.ForwardMessage(chatId, im.Chat.Id, im.MessageId, opts)
}
// Pin Helper method for Bot.PinChatMessage.
func (im InaccessibleMessage) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error) {
return b.PinChatMessage(im.Chat.Id, im.MessageId, opts)
}
// SetReaction Helper method for Bot.SetMessageReaction.
func (im InaccessibleMessage) SetReaction(b *Bot, opts *SetMessageReactionOpts) (bool, error) {
return b.SetMessageReaction(im.Chat.Id, im.MessageId, opts)
}
// StopLiveLocation Helper method for Bot.StopMessageLiveLocation.
func (im InaccessibleMessage) StopLiveLocation(b *Bot, opts *StopMessageLiveLocationOpts) (*Message, bool, error) {
if opts == nil {
opts = &StopMessageLiveLocationOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = im.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = im.MessageId
}
return b.StopMessageLiveLocation(opts)
}
// Unpin Helper method for Bot.UnpinChatMessage.
func (im InaccessibleMessage) Unpin(b *Bot, opts *UnpinChatMessageOpts) (bool, error) {
if opts == nil {
opts = &UnpinChatMessageOpts{}
}
if opts.MessageId == nil {
opts.MessageId = &im.MessageId
}
return b.UnpinChatMessage(im.Chat.Id, opts)
}
// Answer Helper method for Bot.AnswerInlineQuery.
func (iq InlineQuery) Answer(b *Bot, results []InlineQueryResult, opts *AnswerInlineQueryOpts) (bool, error) {
return b.AnswerInlineQuery(iq.Id, results, opts)
}
// Copy Helper method for Bot.CopyMessage.
func (m Message) Copy(b *Bot, chatId int64, opts *CopyMessageOpts) (*MessageId, error) {
return b.CopyMessage(chatId, m.Chat.Id, m.MessageId, opts)
}
// Delete Helper method for Bot.DeleteMessage.
func (m Message) Delete(b *Bot, opts *DeleteMessageOpts) (bool, error) {
return b.DeleteMessage(m.Chat.Id, m.MessageId, opts)
}
// EditCaption Helper method for Bot.EditMessageCaption.
func (m Message) EditCaption(b *Bot, opts *EditMessageCaptionOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageCaptionOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageCaption(opts)
}
// EditLiveLocation Helper method for Bot.EditMessageLiveLocation.
func (m Message) EditLiveLocation(b *Bot, latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageLiveLocationOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageLiveLocation(latitude, longitude, opts)
}
// EditMedia Helper method for Bot.EditMessageMedia.
func (m Message) EditMedia(b *Bot, media InputMedia, opts *EditMessageMediaOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageMediaOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageMedia(media, opts)
}
// EditReplyMarkup Helper method for Bot.EditMessageReplyMarkup.
func (m Message) EditReplyMarkup(b *Bot, opts *EditMessageReplyMarkupOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageReplyMarkupOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageReplyMarkup(opts)
}
// EditText Helper method for Bot.EditMessageText.
func (m Message) EditText(b *Bot, text string, opts *EditMessageTextOpts) (*Message, bool, error) {
if opts == nil {
opts = &EditMessageTextOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.EditMessageText(text, opts)
}
// Forward Helper method for Bot.ForwardMessage.
func (m Message) Forward(b *Bot, chatId int64, opts *ForwardMessageOpts) (*Message, error) {
return b.ForwardMessage(chatId, m.Chat.Id, m.MessageId, opts)
}
// Pin Helper method for Bot.PinChatMessage.
func (m Message) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error) {
return b.PinChatMessage(m.Chat.Id, m.MessageId, opts)
}
// SetReaction Helper method for Bot.SetMessageReaction.
func (m Message) SetReaction(b *Bot, opts *SetMessageReactionOpts) (bool, error) {
return b.SetMessageReaction(m.Chat.Id, m.MessageId, opts)
}
// StopLiveLocation Helper method for Bot.StopMessageLiveLocation.
func (m Message) StopLiveLocation(b *Bot, opts *StopMessageLiveLocationOpts) (*Message, bool, error) {
if opts == nil {
opts = &StopMessageLiveLocationOpts{}
}
if opts.ChatId == 0 {
opts.ChatId = m.Chat.Id
}
if opts.MessageId == 0 {
opts.MessageId = m.MessageId
}
return b.StopMessageLiveLocation(opts)
}
// Unpin Helper method for Bot.UnpinChatMessage.
func (m Message) Unpin(b *Bot, opts *UnpinChatMessageOpts) (bool, error) {
if opts == nil {
opts = &UnpinChatMessageOpts{}
}
if opts.MessageId == nil {
opts.MessageId = &m.MessageId
}
return b.UnpinChatMessage(m.Chat.Id, opts)
}
// Answer Helper method for Bot.AnswerPreCheckoutQuery.
func (pcq PreCheckoutQuery) Answer(b *Bot, ok bool, opts *AnswerPreCheckoutQueryOpts) (bool, error) {
return b.AnswerPreCheckoutQuery(pcq.Id, ok, opts)
}
// Answer Helper method for Bot.AnswerShippingQuery.
func (sq ShippingQuery) Answer(b *Bot, ok bool, opts *AnswerShippingQueryOpts) (bool, error) {
return b.AnswerShippingQuery(sq.Id, ok, opts)
}
// EditStarSubscription Helper method for Bot.EditUserStarSubscription.
func (u User) EditStarSubscription(b *Bot, telegramPaymentChargeId string, isCanceled bool, opts *EditUserStarSubscriptionOpts) (bool, error) {
return b.EditUserStarSubscription(u.Id, telegramPaymentChargeId, isCanceled, opts)
}
// GetChatBoosts Helper method for Bot.GetUserChatBoosts.
func (u User) GetChatBoosts(b *Bot, chatId int64, opts *GetUserChatBoostsOpts) (*UserChatBoosts, error) {
return b.GetUserChatBoosts(chatId, u.Id, opts)
}
// GetProfilePhotos Helper method for Bot.GetUserProfilePhotos.
func (u User) GetProfilePhotos(b *Bot, opts *GetUserProfilePhotosOpts) (*UserProfilePhotos, error) {
return b.GetUserProfilePhotos(u.Id, opts)
}
// RemoveVerification Helper method for Bot.RemoveUserVerification.
func (u User) RemoveVerification(b *Bot, opts *RemoveUserVerificationOpts) (bool, error) {
return b.RemoveUserVerification(u.Id, opts)
}
// SetEmojiStatus Helper method for Bot.SetUserEmojiStatus.
func (u User) SetEmojiStatus(b *Bot, opts *SetUserEmojiStatusOpts) (bool, error) {
return b.SetUserEmojiStatus(u.Id, opts)
}
// Verify Helper method for Bot.VerifyUser.
func (u User) Verify(b *Bot, opts *VerifyUserOpts) (bool, error) {
return b.VerifyUser(u.Id, opts)
}