Repository navigation
Expand file tree
/
Copy pathmethods.go
More file actions
623 lines (533 loc) · 24.5 KB
/
Copy pathmethods.go
File metadata and controls
623 lines (533 loc) · 24.5 KB
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
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
package bot
import (
"context"
"github.com/go-telegram/bot/models"
)
// SetWebhook https://core.telegram.org/bots/api#setwebhook
func (b *Bot) SetWebhook(ctx context.Context, params *SetWebhookParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setWebhook", params, &result)
return result, err
}
// GetWebhookInfo https://core.telegram.org/bots/api#getwebhookinfo
func (b *Bot) GetWebhookInfo(ctx context.Context) (*models.WebhookInfo, error) {
result := &models.WebhookInfo{}
err := b.rawRequest(ctx, "getWebhookInfo", nil, &result)
return result, err
}
// DeleteWebhook https://core.telegram.org/bots/api#deletewebhook
func (b *Bot) DeleteWebhook(ctx context.Context, params *DeleteWebhookParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "deleteWebhook", params, &result)
return result, err
}
// GetMe https://core.telegram.org/bots/api#getme
func (b *Bot) GetMe(ctx context.Context) (*models.User, error) {
result := &models.User{}
err := b.rawRequest(ctx, "getMe", nil, result)
return result, err
}
// Logout https://core.telegram.org/bots/api#logout
func (b *Bot) Logout(ctx context.Context) (bool, error) {
var result bool
err := b.rawRequest(ctx, "logout", nil, &result)
return result, err
}
// Close https://core.telegram.org/bots/api#close
func (b *Bot) Close(ctx context.Context) (bool, error) {
var result bool
err := b.rawRequest(ctx, "close", nil, &result)
return result, err
}
// SendMessage https://core.telegram.org/bots/api#sendmessage
func (b *Bot) SendMessage(ctx context.Context, params *SendMessageParams) (*models.Message, error) {
mes := &models.Message{}
err := b.rawRequest(ctx, "sendMessage", params, mes)
return mes, err
}
// ForwardMessage https://core.telegram.org/bots/api#forwardmessage
func (b *Bot) ForwardMessage(ctx context.Context, params *ForwardMessageParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "forwardMessage", params, result)
return result, err
}
// CopyMessage https://core.telegram.org/bots/api#copymessage
func (b *Bot) CopyMessage(ctx context.Context, params *CopyMessageParams) (*models.MessageID, error) {
result := &models.MessageID{}
err := b.rawRequest(ctx, "forwardMessage", params, result)
return result, err
}
// SendPhoto https://core.telegram.org/bots/api#sendphoto
func (b *Bot) SendPhoto(ctx context.Context, params *SendPhotoParams) (*models.Message, error) {
mes := &models.Message{}
err := b.rawRequest(ctx, "sendPhoto", params, mes)
return mes, err
}
// SendAudio https://core.telegram.org/bots/api#sendaudio
func (b *Bot) SendAudio(ctx context.Context, params *SendAudioParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendAudio", params, result)
return result, err
}
// SendDocument https://core.telegram.org/bots/api#senddocument
func (b *Bot) SendDocument(ctx context.Context, params *SendDocumentParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendDocument", params, result)
return result, err
}
// SendVideo https://core.telegram.org/bots/api#sendvideo
func (b *Bot) SendVideo(ctx context.Context, params *SendVideoParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendVideo", params, result)
return result, err
}
// SendAnimation https://core.telegram.org/bots/api#sendanimation
func (b *Bot) SendAnimation(ctx context.Context, params *SendAnimationParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendAnimation", params, result)
return result, err
}
// SendVoice https://core.telegram.org/bots/api#sendvoice
func (b *Bot) SendVoice(ctx context.Context, params *SendVoiceParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendVoice", params, result)
return result, err
}
// SendVideoNote https://core.telegram.org/bots/api#sendvideonote
func (b *Bot) SendVideoNote(ctx context.Context, params *SendVideoNoteParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendVideoNote", params, result)
return result, err
}
// SendMediaGroup https://core.telegram.org/bots/api#sendmediagroup
func (b *Bot) SendMediaGroup(ctx context.Context, params *SendMediaGroupParams) ([]*models.Message, error) {
var result []*models.Message
err := b.rawRequest(ctx, "sendMediaGroup", params, &result)
return result, err
}
// SendLocation https://core.telegram.org/bots/api#sendlocation
func (b *Bot) SendLocation(ctx context.Context, params *SendLocationParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendLocation", params, result)
return result, err
}
// EditMessageLiveLocation https://core.telegram.org/bots/api#editmessagelivelocation
func (b *Bot) EditMessageLiveLocation(ctx context.Context, params *EditMessageLiveLocationParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "editMessageLiveLocation", params, result)
return result, err
}
// StopMessageLiveLocation https://core.telegram.org/bots/api#stopmessagelivelocation
func (b *Bot) StopMessageLiveLocation(ctx context.Context, params *StopMessageLiveLocationParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "stopMessageLiveLocation", params, result)
return result, err
}
// SendVenue https://core.telegram.org/bots/api#sendvenue
func (b *Bot) SendVenue(ctx context.Context, params *SendVenueParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendVenue", params, result)
return result, err
}
// SendContact https://core.telegram.org/bots/api#sendcontact
func (b *Bot) SendContact(ctx context.Context, params *SendContactParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendContact", params, result)
return result, err
}
// SendPoll https://core.telegram.org/bots/api#sendpoll
func (b *Bot) SendPoll(ctx context.Context, params *SendPollParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendPoll", params, result)
return result, err
}
// SendDice https://core.telegram.org/bots/api#senddice
func (b *Bot) SendDice(ctx context.Context, params *SendDiceParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendDice", params, &result)
return result, err
}
// SendChatAction https://core.telegram.org/bots/api#sendchataction
func (b *Bot) SendChatAction(ctx context.Context, params *SendChatActionParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "sendDice", params, &result)
return result, err
}
// GetUserProfilePhotos https://core.telegram.org/bots/api#getuserprofilephotos
func (b *Bot) GetUserProfilePhotos(ctx context.Context, params *GetUserProfilePhotosParams) (*models.UserProfilePhotos, error) {
result := &models.UserProfilePhotos{}
err := b.rawRequest(ctx, "getUserProfilePhotos", params, result)
return result, err
}
// GetFile https://core.telegram.org/bots/api#getfile
func (b *Bot) GetFile(ctx context.Context, params *GetFileParams) (*models.File, error) {
result := &models.File{}
err := b.rawRequest(ctx, "getFile", params, result)
return result, err
}
// BanChatMember https://core.telegram.org/bots/api#banchatmember
func (b *Bot) BanChatMember(ctx context.Context, params *BanChatMemberParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "banChatMember", params, &result)
return result, err
}
// UnbanChatMember https://core.telegram.org/bots/api#unbanchatmember
func (b *Bot) UnbanChatMember(ctx context.Context, params *UnbanChatMemberParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "unbanChatMember", params, &result)
return result, err
}
// RestrictChatMember https://core.telegram.org/bots/api#restrictchatmember
func (b *Bot) RestrictChatMember(ctx context.Context, params *RestrictChatMemberParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "restrictChatMember", params, &result)
return result, err
}
// PromoteChatMember https://core.telegram.org/bots/api#promotechatmember
func (b *Bot) PromoteChatMember(ctx context.Context, params *PromoteChatMemberParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "promoteChatMember", params, &result)
return result, err
}
// SetChatAdministratorCustomTitle https://core.telegram.org/bots/api#setchatadministratorcustomtitle
func (b *Bot) SetChatAdministratorCustomTitle(ctx context.Context, params *SetChatAdministratorCustomTitleParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatAdministratorCustomTitle", params, &result)
return result, err
}
// BanChatSenderChat https://core.telegram.org/bots/api#banchatsenderchat
func (b *Bot) BanChatSenderChat(ctx context.Context, params *BanChatSenderChatParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "banChatSenderChat", params, &result)
return result, err
}
// UnbanChatSenderChat https://core.telegram.org/bots/api#unbanchatsenderchat
func (b *Bot) UnbanChatSenderChat(ctx context.Context, params *UnbanChatSenderChatParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "unbanChatSenderChat", params, &result)
return result, err
}
// SetChatPermissions https://core.telegram.org/bots/api#setchatpermissions
func (b *Bot) SetChatPermissions(ctx context.Context, params *SetChatPermissionsParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatPermissions", params, &result)
return result, err
}
// ExportChatInviteLink https://core.telegram.org/bots/api#exportchatinvitelink
func (b *Bot) ExportChatInviteLink(ctx context.Context, params *ExportChatInviteLinkParams) (string, error) {
var result string
err := b.rawRequest(ctx, "exportChatInviteLink", params, &result)
return result, err
}
// CreateChatInviteLink https://core.telegram.org/bots/api#createchatinvitelink
func (b *Bot) CreateChatInviteLink(ctx context.Context, params *CreateChatInviteLinkParams) (*models.ChatInviteLink, error) {
result := &models.ChatInviteLink{}
err := b.rawRequest(ctx, "createChatInviteLink", params, &result)
return result, err
}
// EditChatInviteLink https://core.telegram.org/bots/api#editchatinvitelink
func (b *Bot) EditChatInviteLink(ctx context.Context, params *EditChatInviteLinkParams) (*models.ChatInviteLink, error) {
result := &models.ChatInviteLink{}
err := b.rawRequest(ctx, "editChatInviteLink", params, &result)
return result, err
}
// RevokeChatInviteLink https://core.telegram.org/bots/api#revokechatinvitelink
func (b *Bot) RevokeChatInviteLink(ctx context.Context, params *RevokeChatInviteLinkParams) (*models.ChatInviteLink, error) {
result := &models.ChatInviteLink{}
err := b.rawRequest(ctx, "revokeChatInviteLink", params, &result)
return result, err
}
// ApproveChatJoinRequest https://core.telegram.org/bots/api#approvechatjoinrequest
func (b *Bot) ApproveChatJoinRequest(ctx context.Context, params *ApproveChatJoinRequestParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "approveChatJoinRequest", params, &result)
return result, err
}
// DeclineChatJoinRequest https://core.telegram.org/bots/api#declinechatjoinrequest
func (b *Bot) DeclineChatJoinRequest(ctx context.Context, params *DeclineChatJoinRequestParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "declineChatJoinRequest", params, &result)
return result, err
}
// SetChatPhoto https://core.telegram.org/bots/api#setchatphoto
func (b *Bot) SetChatPhoto(ctx context.Context, params *SetChatPhotoParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatPhoto", params, &result)
return result, err
}
// DeleteChatPhoto https://core.telegram.org/bots/api#deletechatphoto
func (b *Bot) DeleteChatPhoto(ctx context.Context, params *DeleteChatPhotoParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "deleteChatPhoto", params, &result)
return result, err
}
// SetChatTitle https://core.telegram.org/bots/api#setchattitle
func (b *Bot) SetChatTitle(ctx context.Context, params *SetChatTitleParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatTitle", params, &result)
return result, err
}
// SetChatDescription https://core.telegram.org/bots/api#setchatdescription
func (b *Bot) SetChatDescription(ctx context.Context, params *SetChatDescriptionParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatDescription", params, &result)
return result, err
}
// PinChatMessage https://core.telegram.org/bots/api#pinchatmessage
func (b *Bot) PinChatMessage(ctx context.Context, params *PinChatMessageParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "pinChatMessage", params, &result)
return result, err
}
// UnpinChatMessage https://core.telegram.org/bots/api#unpinchatmessage
func (b *Bot) UnpinChatMessage(ctx context.Context, params *UnpinChatMessageParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "unpinChatMessage", params, &result)
return result, err
}
// UnpinAllChatMessages https://core.telegram.org/bots/api#unpinallchatmessages
func (b *Bot) UnpinAllChatMessages(ctx context.Context, params *UnpinAllChatMessagesParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "unpinAllChatMessages", params, &result)
return result, err
}
// LeaveChat https://core.telegram.org/bots/api#leavechat
func (b *Bot) LeaveChat(ctx context.Context, params *LeaveChatParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "leaveChat", params, &result)
return result, err
}
// GetChat https://core.telegram.org/bots/api#getchat
func (b *Bot) GetChat(ctx context.Context, params *GetChatParams) (*models.Chat, error) {
var result *models.Chat
err := b.rawRequest(ctx, "getChat", params, &result)
return result, err
}
// GetChatAdministrators https://core.telegram.org/bots/api#getchatadministrators
func (b *Bot) GetChatAdministrators(ctx context.Context, params *GetChatAdministratorsParams) ([]models.ChatMember, error) {
var result []models.ChatMember
err := b.rawRequest(ctx, "getChatAdministrators", params, &result)
return result, err
}
// GetChatMemberCount https://core.telegram.org/bots/api#getchatmembercount
func (b *Bot) GetChatMemberCount(ctx context.Context, params *GetChatMemberCountParams) (int, error) {
var result int
err := b.rawRequest(ctx, "getChatMemberCount", params, &result)
return result, err
}
// GetChatMember https://core.telegram.org/bots/api#getchatmember
func (b *Bot) GetChatMember(ctx context.Context, params *GetChatMemberParams) (*models.ChatMember, error) {
result := &models.ChatMember{}
err := b.rawRequest(ctx, "getChatMember", params, &result)
return result, err
}
// SetChatStickerSet https://core.telegram.org/bots/api#setchatstickerset
func (b *Bot) SetChatStickerSet(ctx context.Context, params *SetChatStickerSetParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatStickerSet", params, &result)
return result, err
}
// DeleteChatStickerSet https://core.telegram.org/bots/api#deletechatstickerset
func (b *Bot) DeleteChatStickerSet(ctx context.Context, params *DeleteChatStickerSetParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "deleteChatStickerSet", params, &result)
return result, err
}
// AnswerCallbackQuery https://core.telegram.org/bots/api#answercallbackquery
func (b *Bot) AnswerCallbackQuery(ctx context.Context, params *AnswerCallbackQueryParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "answerCallbackQuery", params, &result)
return result, err
}
// SetMyCommands https://core.telegram.org/bots/api#setmycommands
func (b *Bot) SetMyCommands(ctx context.Context, params *SetMyCommandsParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setMyCommands", params, &result)
return result, err
}
// DeleteMyCommands https://core.telegram.org/bots/api#deletemycommands
func (b *Bot) DeleteMyCommands(ctx context.Context, params *DeleteMyCommandsParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "deleteMyCommands", params, &result)
return result, err
}
// GetMyCommands https://core.telegram.org/bots/api#getmycommands
func (b *Bot) GetMyCommands(ctx context.Context, params *GetMyCommandsParams) ([]models.BotCommand, error) {
var result []models.BotCommand
err := b.rawRequest(ctx, "getMyCommands", params, &result)
return result, err
}
// SetChatMenuButton https://core.telegram.org/bots/api#setchatmenubutton
func (b *Bot) SetChatMenuButton(ctx context.Context, params *SetChatMenuButtonParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setChatMenuButton", params, &result)
return result, err
}
// GetChatMenuButton https://core.telegram.org/bots/api#getchatmenubutton
func (b *Bot) GetChatMenuButton(ctx context.Context, params *GetChatMenuButtonParams) (models.MenuButton, error) {
var result models.MenuButton
err := b.rawRequest(ctx, "getChatMenuButton", params, &result)
return result, err
}
// SetMyDefaultAdministratorRights https://core.telegram.org/bots/api#setmydefaultadministratorrights
func (b *Bot) SetMyDefaultAdministratorRights(ctx context.Context, params *SetMyDefaultAdministratorRightsParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setMyDefaultAdministratorRights", params, &result)
return result, err
}
// GetMyDefaultAdministratorRights https://core.telegram.org/bots/api#getmydefaultadministratorrights
func (b *Bot) GetMyDefaultAdministratorRights(ctx context.Context, params *GetMyDefaultAdministratorRightsParams) (*models.ChatAdministratorRights, error) {
result := &models.ChatAdministratorRights{}
err := b.rawRequest(ctx, "setMyDefaultAdministratorRights", params, &result)
return result, err
}
// EditMessageText https://core.telegram.org/bots/api#editmessagetext
func (b *Bot) EditMessageText(ctx context.Context, params *EditMessageTextParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "editMessageText", params, result)
return result, err
}
// EditMessageCaption https://core.telegram.org/bots/api#editmessagecaption
func (b *Bot) EditMessageCaption(ctx context.Context, params *EditMessageCaptionParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "editMessageCaption", params, result)
return result, err
}
// EditMessageMedia https://core.telegram.org/bots/api#editmessagemedia
func (b *Bot) EditMessageMedia(ctx context.Context, params *EditMessageMediaParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "editMessageMedia", params, result)
return result, err
}
// EditMessageReplyMarkup https://core.telegram.org/bots/api#editmessagereplymarkup
func (b *Bot) EditMessageReplyMarkup(ctx context.Context, params *EditMessageReplyMarkupParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "editMessageReplyMarkup", params, result)
return result, err
}
// StopPoll https://core.telegram.org/bots/api#stoppoll
func (b *Bot) StopPoll(ctx context.Context, params *StopPollParams) (*models.Poll, error) {
result := &models.Poll{}
err := b.rawRequest(ctx, "stopPoll", params, &result)
return result, err
}
// DeleteMessage https://core.telegram.org/bots/api#deletemessage
func (b *Bot) DeleteMessage(ctx context.Context, params *DeleteMessageParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "deleteMessage", params, &result)
return result, err
}
// SendSticker https://core.telegram.org/bots/api#sendsticker
func (b *Bot) SendSticker(ctx context.Context, params *SendStickerParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendSticker", params, &result)
return result, err
}
// GetStickerSet https://core.telegram.org/bots/api#getstickerset
func (b *Bot) GetStickerSet(ctx context.Context, params *GetStickerSetParams) (*models.StickerSet, error) {
result := &models.StickerSet{}
err := b.rawRequest(ctx, "getStickerSet", params, &result)
return result, err
}
// GetCustomEmojiStickers https://core.telegram.org/bots/api#getcustomemojistickers
func (b *Bot) GetCustomEmojiStickers(ctx context.Context, params *GetCustomEmojiStickersParams) ([]*models.Sticker, error) {
var result []*models.Sticker
err := b.rawRequest(ctx, "getCustomEmojiStickers", params, &result)
return result, err
}
// UploadStickerFile https://core.telegram.org/bots/api#uploadstickerfile
func (b *Bot) UploadStickerFile(ctx context.Context, params *UploadStickerFileParams) (*models.File, error) {
result := &models.File{}
err := b.rawRequest(ctx, "uploadStickerFile", params, &result)
return result, err
}
// CreateNewStickerSet https://core.telegram.org/bots/api#createnewstickerset
func (b *Bot) CreateNewStickerSet(ctx context.Context, params *CreateNewStickerSetParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "createNewStickerSet", params, &result)
return result, err
}
// AddStickerToSet https://core.telegram.org/bots/api#addstickertoset
func (b *Bot) AddStickerToSet(ctx context.Context, params *AddStickerToSetParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "addStickerToSet", params, &result)
return result, err
}
// SetStickerPositionInSet https://core.telegram.org/bots/api#setstickerpositioninset
func (b *Bot) SetStickerPositionInSet(ctx context.Context, params *SetStickerPositionInSetParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setStickerPositionInSet", params, &result)
return result, err
}
// DeleteStickerFromSet https://core.telegram.org/bots/api#deletestickerfromset
func (b *Bot) DeleteStickerFromSet(ctx context.Context, params *DeleteStickerFromSetParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "deleteStickerFromSet", params, &result)
return result, err
}
// SetStickerSetThumb https://core.telegram.org/bots/api#setstickersetthumb
func (b *Bot) SetStickerSetThumb(ctx context.Context, params *SetStickerSetThumbParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setStickerSetThumb", params, &result)
return result, err
}
// AnswerInlineQuery https://core.telegram.org/bots/api#answerinlinequery
func (b *Bot) AnswerInlineQuery(ctx context.Context, params *AnswerInlineQueryParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "answerInlineQuery", params, &result)
return result, err
}
// AnswerWebAppQuery https://core.telegram.org/bots/api#answerwebappquery
func (b *Bot) AnswerWebAppQuery(ctx context.Context, params *AnswerWebAppQueryParams) (*models.SentWebAppMessage, error) {
result := &models.SentWebAppMessage{}
err := b.rawRequest(ctx, "answerWebAppQuery", params, result)
return result, err
}
// SendInvoice https://core.telegram.org/bots/api#sendinvoice
func (b *Bot) SendInvoice(ctx context.Context, params *SendInvoiceParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendInvoice", params, result)
return result, err
}
// CreateInvoiceLink https://core.telegram.org/bots/api#createinvoicelink
func (b *Bot) CreateInvoiceLink(ctx context.Context, params *CreateInvoiceLinkParams) (string, error) {
var result string
err := b.rawRequest(ctx, "createInvoiceLink", params, &result)
return result, err
}
// AnswerShippingQuery https://core.telegram.org/bots/api#answershippingquery
func (b *Bot) AnswerShippingQuery(ctx context.Context, params *AnswerShippingQueryParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "answerShippingQuery", params, &result)
return result, err
}
// AnswerPreCheckoutQuery https://core.telegram.org/bots/api#answerprecheckoutquery
func (b *Bot) AnswerPreCheckoutQuery(ctx context.Context, params *AnswerPreCheckoutQueryParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "answerPreCheckoutQuery", params, &result)
return result, err
}
// SetPassportDataErrors https://core.telegram.org/bots/api#setpassportdataerrors
func (b *Bot) SetPassportDataErrors(ctx context.Context, params *SetPassportDataErrorsParams) (bool, error) {
var result bool
err := b.rawRequest(ctx, "setPassportDataErrors", params, &result)
return result, err
}
// SendGame https://core.telegram.org/bots/api#sendgame
func (b *Bot) SendGame(ctx context.Context, params *SendGameParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "sendGame", params, result)
return result, err
}
// SetGameScore https://core.telegram.org/bots/api#setgamescore
func (b *Bot) SetGameScore(ctx context.Context, params *SetGameScoreParams) (*models.Message, error) {
result := &models.Message{}
err := b.rawRequest(ctx, "setGameScore", params, result)
return result, err
}
// GetGameHighScores https://core.telegram.org/bots/api#getgamehighscores
func (b *Bot) GetGameHighScores(ctx context.Context, params *GetGameHighScoresParams) (*models.GameHighScore, error) {
result := &models.GameHighScore{}
err := b.rawRequest(ctx, "getGameHighScores", params, result)
return result, err
}