-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmethods_options.go
3047 lines (2567 loc) · 112 KB
/
methods_options.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
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
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package telegrambot
// https://core.telegram.org/bots/api#available-methods
// MethodOptions is a type for methods' options parameter.
type MethodOptions map[string]any
// OptionsSetWebhook struct for SetWebhook().
//
// options include: `certificate`, `ip_address`, `max_connections`, `allowed_updates`, `drop_pending_updates`, and `secret_token`.
//
// https://core.telegram.org/bots/api#setwebhook
type OptionsSetWebhook MethodOptions
// SetCertificate sets the `certificate` value of OptionsSetWebhook.
func (o OptionsSetWebhook) SetCertificate(filepath string) OptionsSetWebhook {
o["certificate"] = filepath
return o
}
// SetIPAddress sets the `ip_address` value of OptionsSetWebhook.
func (o OptionsSetWebhook) SetIPAddress(address string) OptionsSetWebhook {
o["ip_address"] = address
return o
}
// SetMaxConnections sets the `max_connections` value of OptionsSetWebhook.
//
// maxConnections: 1 ~ 100 (default: 40)
func (o OptionsSetWebhook) SetMaxConnections(maxConnections int) OptionsSetWebhook {
o["max_connections"] = maxConnections
return o
}
// SetAllowedUpdates sets the `allowed_updates` value of OptionsSetWebhook.
func (o OptionsSetWebhook) SetAllowedUpdates(allowedUpdates []UpdateType) OptionsSetWebhook {
o["allowed_updates"] = allowedUpdates
return o
}
// SetDropPendingUpdates sets the `drop_pending_updates` value of OptionsSetWebhook.
func (o OptionsSetWebhook) SetDropPendingUpdates(drop bool) OptionsSetWebhook {
o["drop_pending_updates"] = drop
return o
}
// SetSecretToken sets the `secret_token` value of OptionsSetWebhook.
func (o OptionsSetWebhook) SetSecretToken(token string) OptionsSetWebhook {
o["secret_token"] = token
return o
}
// OptionsGetUpdates struct for GetUpdates().
//
// options include: `offset`, `limit`, `timeout`, and `allowed_updates`.
//
// https://core.telegram.org/bots/api#getupdates
type OptionsGetUpdates MethodOptions
// SetOffset sets the `offset` value of OptionsGetUpdates.
func (o OptionsGetUpdates) SetOffset(offset int64) OptionsGetUpdates {
o["offset"] = offset
return o
}
// SetLimit sets the `limit` value of OptionsGetUpdates.
func (o OptionsGetUpdates) SetLimit(limit int) OptionsGetUpdates {
o["limit"] = limit
return o
}
// SetTimeout sets the `timeout` value of OptionsGetUpdates.
func (o OptionsGetUpdates) SetTimeout(timeout int) OptionsGetUpdates {
o["timeout"] = timeout
return o
}
// SetAllowedUpdates sets the `allowed_updates` value of OptionsGetUpdates.
func (o OptionsGetUpdates) SetAllowedUpdates(allowedUpdates []AllowedUpdate) OptionsGetUpdates {
o["allowed_updates"] = allowedUpdates
return o
}
// OptionsSendMessage struct for SendMessage().
//
// options include: `business_connection_id`, `message_thread_id`, `parse_mode`, `entities`, `link_preview_options`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendmessage
type OptionsSendMessage MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendMessage.
func (o OptionsSendMessage) SetBusinessConnectionID(businessConnectionID string) OptionsSendMessage {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendMessage.
func (o OptionsSendMessage) SetMessageThreadID(messageThreadID int64) OptionsSendMessage {
o["message_thread_id"] = messageThreadID
return o
}
// SetParseMode sets the `parse_mode` value of OptionsSendMessage.
func (o OptionsSendMessage) SetParseMode(parseMode ParseMode) OptionsSendMessage {
o["parse_mode"] = parseMode
return o
}
// SetEntities sets the `entities` value of OptionsSendMessage.
func (o OptionsSendMessage) SetEntities(entities []MessageEntity) OptionsSendMessage {
o["entities"] = entities
return o
}
// SetLinkPreviewOptions sets the `link_preview_options` value of OptionsSendMessage.
func (o OptionsSendMessage) SetLinkPreviewOptions(linkPreviewOptions LinkPreviewOptions) OptionsSendMessage {
o["link_preview_options"] = linkPreviewOptions
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendMessage.
func (o OptionsSendMessage) SetDisableNotification(disable bool) OptionsSendMessage {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendMessage.
func (o OptionsSendMessage) SetProtectContent(protect bool) OptionsSendMessage {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendMessage.
func (o OptionsSendMessage) SetAllowPaidBroadcast(allow bool) OptionsSendMessage {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendMessage.
func (o OptionsSendMessage) SetMessageEffectID(messageEffectID string) OptionsSendMessage {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendMessage.
func (o OptionsSendMessage) SetReplyParameters(replyParameters ReplyParameters) OptionsSendMessage {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the `reply_markup` value of OptionsSendMessage.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendMessage) SetReplyMarkup(replyMarkup any) OptionsSendMessage {
o["reply_markup"] = replyMarkup
return o
}
// OptionsForwardMessage struct for ForwardMessage().
//
// options include: `message_thread_id`, `disable_notification` and `protect_content`.
//
// https://core.telegram.org/bots/api#forwardmessage
type OptionsForwardMessage MethodOptions
// SetMessageThreadID sets the `message_thread_id` value of OptionsForwardMessage.
func (o OptionsForwardMessage) SetMessageThreadID(messageThreadID int64) OptionsForwardMessage {
o["message_thread_id"] = messageThreadID
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsForwardMessage.
func (o OptionsForwardMessage) SetDisableNotification(disable bool) OptionsForwardMessage {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsForwardMessage.
func (o OptionsForwardMessage) SetProtectContent(protect bool) OptionsForwardMessage {
o["protect_content"] = protect
return o
}
// OptionsCopyMessage struct for CopyMessage().
//
// options include: `message_thread_id`, `caption`, `parse_mode`, `caption_entities`, `show_caption_above_media`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `reply_parameters`, and `reply_markup`
//
// https://core.telegram.org/bots/api#copymessage
type OptionsCopyMessage MethodOptions
// SetMessageThreadID sets the `message_thread_id` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetMessageThreadID(messageThreadID int64) OptionsCopyMessage {
o["message_thread_id"] = messageThreadID
return o
}
// SetCaption sets the `caption` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetCaption(caption string) OptionsCopyMessage {
o["caption"] = caption
return o
}
// SetParseMode sets the `parse_mode` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetParseMode(parseMode ParseMode) OptionsCopyMessage {
o["parse_mode"] = parseMode
return o
}
// SetCaptionEntities sets the `caption_entities` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetCaptionEntities(entities []MessageEntity) OptionsCopyMessage {
o["caption_entities"] = entities
return o
}
// SetShowCaptionAboveMedia sets the `show_caption_above_media` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetShowCaptionAboveMedia(showCaptionAboveMedia bool) OptionsCopyMessage {
o["show_caption_above_media"] = showCaptionAboveMedia
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetDisableNotification(disable bool) OptionsCopyMessage {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetProtectContent(protect bool) OptionsCopyMessage {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetAllowPaidBroadcast(allow bool) OptionsCopyMessage {
o["allow_paid_broadcast"] = allow
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsCopyMessage.
func (o OptionsCopyMessage) SetReplyParameters(replyParameters ReplyParameters) OptionsCopyMessage {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the reply_markup value of OptionsCopyMessage.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsCopyMessage) SetReplyMarkup(replyMarkup any) OptionsCopyMessage {
o["reply_markup"] = replyMarkup
return o
}
// OptionsCopyMessages struct for CopyMessages().
//
// options include: `message_thread_id`, `disable_notification`, `protect_content`, and `remove_caption`
//
// https://core.telegram.org/bots/api#copymessages
type OptionsCopyMessages MethodOptions
// SetMessageThreadID sets the `message_thread_id` value of OptionsCopyMessages.
func (o OptionsCopyMessages) SetMessageThreadID(messageThreadID int64) OptionsCopyMessages {
o["message_thread_id"] = messageThreadID
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsCopyMessages.
func (o OptionsCopyMessages) SetDisableNotification(disable bool) OptionsCopyMessages {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsCopyMessages.
func (o OptionsCopyMessages) SetProtectContent(protect bool) OptionsCopyMessages {
o["protect_content"] = protect
return o
}
// SetRemoveCaption sets the `remove_caption` value of OptionsCopyMessages.
func (o OptionsCopyMessages) SetRemoveCaption(removeCaption bool) OptionsCopyMessages {
o["remove_caption"] = removeCaption
return o
}
// OptionsSendPhoto struct for SendPhoto().
//
// options include: `business_connection_id`, `message_thread_id`, `caption`, `parse_mode`, `caption_entities`, `show_caption_above_media`, `has_spoiler`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendphoto
type OptionsSendPhoto MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetBusinessConnectionID(businessConnectionID string) OptionsSendPhoto {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id`value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetMessageThreadID(messageThreadID int64) OptionsSendPhoto {
o["message_thread_id"] = messageThreadID
return o
}
// SetCaption sets the `caption` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetCaption(caption string) OptionsSendPhoto {
o["caption"] = caption
return o
}
// SetParseMode sets the `parse_mode` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetParseMode(parseMode ParseMode) OptionsSendPhoto {
o["parse_mode"] = parseMode
return o
}
// SetCaptionEntities sets the `caption_entities` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetCaptionEntities(entities []MessageEntity) OptionsSendPhoto {
o["caption_entities"] = entities
return o
}
// SetShowCaptionAboveMedia sets the `show_caption_above_media` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetShowCaptionAboveMedia(showCaptionAboveMedia bool) OptionsSendPhoto {
o["show_caption_above_media"] = showCaptionAboveMedia
return o
}
// SetHasSpoiler sets the `has_spoiler` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetHasSpiler(hasSpoiler bool) OptionsSendPhoto {
o["has_spoiler"] = hasSpoiler
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetDisableNotification(disable bool) OptionsSendPhoto {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetProtectContent(protect bool) OptionsSendPhoto {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetAllowPaidBroadcast(allow bool) OptionsSendPhoto {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetMessageEffectID(messageEffectID string) OptionsSendPhoto {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendPhoto.
func (o OptionsSendPhoto) SetReplyParameters(replyParameters ReplyParameters) OptionsSendPhoto {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the `reply_markup` value of OptionsSendPhoto.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendPhoto) SetReplyMarkup(replyMarkup any) OptionsSendPhoto {
o["reply_markup"] = replyMarkup
return o
}
// OptionsSendAudio struct for SendAudio().
//
// options include: `business_connection_id`, `message_thread_id`, `caption`, `parse_mode`, `caption_entities`, `duration`, `performer`, `title`, `thumbnail`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendaudio
type OptionsSendAudio MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendAudio.
func (o OptionsSendAudio) SetBusinessConnectionID(businessConnectionID string) OptionsSendAudio {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendAudio.
func (o OptionsSendAudio) SetMessageThreadID(messageThreadID int64) OptionsSendAudio {
o["message_thread_id"] = messageThreadID
return o
}
// SetCaption sets the `caption` value of OptionsSendAudio.
func (o OptionsSendAudio) SetCaption(caption string) OptionsSendAudio {
o["caption"] = caption
return o
}
// SetParseMode sets the `parse_mode` value of OptionsSendAudio.
func (o OptionsSendAudio) SetParseMode(parseMode ParseMode) OptionsSendAudio {
o["parse_mode"] = parseMode
return o
}
// SetCaptionEntities sets the `caption_entities` value of OptionsSendAudio.
func (o OptionsSendAudio) SetCaptionEntities(entities []MessageEntity) OptionsSendAudio {
o["caption_entities"] = entities
return o
}
// SetDuration sets the `duration` value of OptionsSendAudio.
func (o OptionsSendAudio) SetDuration(duration int) OptionsSendAudio {
o["duration"] = duration
return o
}
// SetPerformer sets the `performer` value of OptionsSendAudio.
func (o OptionsSendAudio) SetPerformer(performer string) OptionsSendAudio {
o["performer"] = performer
return o
}
// SetTitle sets the `title` value of OptionsSendAudio.
func (o OptionsSendAudio) SetTitle(title string) OptionsSendAudio {
o["title"] = title
return o
}
// SetThumbnail sets the `thumbnail` value of OptionsSendAudio.
//
// `thumbnail` can be one of InputFile or string.
func (o OptionsSendAudio) SetThumbnail(thumbnail any) OptionsSendAudio {
o["thumbnail"] = thumbnail
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendAudio.
func (o OptionsSendAudio) SetDisableNotification(disable bool) OptionsSendAudio {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendAudio.
func (o OptionsSendAudio) SetProtectContent(protect bool) OptionsSendAudio {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendAudio.
func (o OptionsSendAudio) SetAllowPaidBroadcast(allow bool) OptionsSendAudio {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendAudio.
func (o OptionsSendAudio) SetMessageEffectID(messageEffectID string) OptionsSendAudio {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendAudio.
func (o OptionsSendAudio) SetReplyParameters(replyParameters ReplyParameters) OptionsSendAudio {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the `reply_markup` value of OptionsSendAudio.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendAudio) SetReplyMarkup(replyMarkup any) OptionsSendAudio {
o["reply_markup"] = replyMarkup
return o
}
// OptionsSendDocument struct for SendDocument().
//
// options include: `business_connection_id`, `message_thread_id`, `thumbnail`, `caption`, `parse_mode`, `caption_entities`, `disable_content_type_detection`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#senddocument
type OptionsSendDocument MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendDocument.
func (o OptionsSendDocument) SetBusinessConnectionID(businessConnectionID string) OptionsSendDocument {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendDocument.
func (o OptionsSendDocument) SetMessageThreadID(messageThreadID int64) OptionsSendDocument {
o["message_thread_id"] = messageThreadID
return o
}
// SetThumbnail sets the thumbnail value of OptionsSendDocument.
//
// `thumbnail` can be one of InputFile or string.
func (o OptionsSendDocument) SetThumbnail(thumbnail any) OptionsSendDocument {
o["thumbnail"] = thumbnail
return o
}
// SetCaption sets the `caption` value of OptionsSendDocument.
func (o OptionsSendDocument) SetCaption(caption string) OptionsSendDocument {
o["caption"] = caption
return o
}
// SetParseMode sets the `parse_mode` value of OptionsSendDocument.
func (o OptionsSendDocument) SetParseMode(parseMode ParseMode) OptionsSendDocument {
o["parse_mode"] = parseMode
return o
}
// SetCaptionEntities sets the `caption_entities` value of OptionsSendDocument.
func (o OptionsSendDocument) SetCaptionEntities(entities []MessageEntity) OptionsSendDocument {
o["caption_entities"] = entities
return o
}
// SetDisableContentTypeDetection sets the `disable_content_type_detection` value of OptionsSendDocument.
func (o OptionsSendDocument) SetDisableContentTypeDetection(disable bool) OptionsSendDocument {
o["disable_content_type_detection"] = disable
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendDocument.
func (o OptionsSendDocument) SetDisableNotification(disable bool) OptionsSendDocument {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendDocument.
func (o OptionsSendDocument) SetProtectContent(protect bool) OptionsSendDocument {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendDocument.
func (o OptionsSendDocument) SetAllowPaidBroadcast(allow bool) OptionsSendDocument {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendDocument.
func (o OptionsSendDocument) SetMessageEffectID(messageEffectID string) OptionsSendDocument {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendDocument.
func (o OptionsSendDocument) SetReplyParameters(replyParameters ReplyParameters) OptionsSendDocument {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the reply_markup value of OptionsSendDocument.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendDocument) SetReplyMarkup(replyMarkup any) OptionsSendDocument {
o["reply_markup"] = replyMarkup
return o
}
// OptionsSendSticker struct for SendSticker().
//
// options include: `business_connection_id`, `message_thread_id`, `emoji`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendsticker
type OptionsSendSticker MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendSticker.
func (o OptionsSendSticker) SetBusinessConnectionID(businessConnectionID string) OptionsSendSticker {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendSticker.
func (o OptionsSendSticker) SetMessageThreadID(messageThreadID int64) OptionsSendSticker {
o["message_thread_id"] = messageThreadID
return o
}
// SetEmoji sets the `emoji` value of OptionsSendSticker.
func (o OptionsSendSticker) SetEmoji(emoji string) OptionsSendSticker {
o["emoji"] = emoji
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendSticker.
func (o OptionsSendSticker) SetDisableNotification(disable bool) OptionsSendSticker {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendSticker.
func (o OptionsSendSticker) SetProtectContent(protect bool) OptionsSendSticker {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendSticker.
func (o OptionsSendSticker) SetAllowPaidBroadcast(allow bool) OptionsSendSticker {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendSticker.
func (o OptionsSendSticker) SetMessageEffectID(messageEffectID string) OptionsSendSticker {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendSticker.
func (o OptionsSendSticker) SetReplyParameters(replyParameters ReplyParameters) OptionsSendSticker {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the `reply_markup` value of OptionsSendSticker.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendSticker) SetReplyMarkup(replyMarkup any) OptionsSendSticker {
o["reply_markup"] = replyMarkup
return o
}
// OptionsCreateNewStickerSet struct for CreateNewStickerSet().
//
// options include: `sticker_type`, and `needs_repainting`.
//
// https://core.telegram.org/bots/api#createnewstickerset
type OptionsCreateNewStickerSet MethodOptions
// SetStickerType sets the `sticker_type` value of OptionsCreateNewStickerSet.
func (o OptionsCreateNewStickerSet) SetStickerType(stickerType StickerType) OptionsCreateNewStickerSet {
o["sticker_type"] = stickerType
return o
}
// SetNeedsRepainting sets the `needs_repainting` value of OptionsCreateNewStickerSet.
func (o OptionsCreateNewStickerSet) SetNeedsRepainting(needsRepainting bool) OptionsCreateNewStickerSet {
o["needs_repainting"] = needsRepainting
return o
}
// OptionsAddStickerToSet struct for AddStickerToSet()
//
// options include: nothing for now
//
// https://core.telegram.org/bots/api#addstickertoset
type OptionsAddStickerToSet MethodOptions
// OptionsSetStickerSetThumbnail struct for SetStickerSetThumbnail()
//
// options include: `thumbnail`.
//
// https://core.telegram.org/bots/api#setstickersetthumbnail
type OptionsSetStickerSetThumbnail MethodOptions
// SetThumbnail sets the `thumbnail` value of OptionsSetStickerSetThumbnail.
func (o OptionsSetStickerSetThumbnail) SetThumbnail(thumbnail InputFile) OptionsSetStickerSetThumbnail {
o["thumbnail"] = thumbnail
return o
}
// SetThumbnailString sets the `thumbnail` value of OptionsSetStickerSetThumbnail.
//
// `thumbnail` can be a file_id or a http url to a file
func (o OptionsSetStickerSetThumbnail) SetThumbnailString(thumbnail string) OptionsSetStickerSetThumbnail {
o["thumbnail"] = thumbnail
return o
}
// OptionsSetCustomEmojiStickerSetThumbnail struct for SetCustomEmojiStickerSet()
//
// options include: `custom_emoji_id`.
//
// https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
type OptionsSetCustomEmojiStickerSetThumbnail MethodOptions
// SetCustomEmojiID sets the `custom_emoji_id` value of OptionsSetCustomEmojiStickerSetThumbnail.
func (o OptionsSetCustomEmojiStickerSetThumbnail) SetCustomEmojiID(customEmojiID string) OptionsSetCustomEmojiStickerSetThumbnail {
o["custom_emoji_id"] = customEmojiID
return o
}
// OptionsSetStickerMaskPosition struct for SetStickerMaskPosition()
//
// options include: `mask_position`.
//
// https://core.telegram.org/bots/api#setstickermaskposition
type OptionsSetStickerMaskPosition MethodOptions
// SetMaskPosition sets the `mask_position` value of OptionsSetStickerMaskPosition.
func (o OptionsSetStickerMaskPosition) SetMaskPosition(maskPosition MaskPosition) OptionsSetStickerMaskPosition {
o["mask_position"] = maskPosition
return o
}
// OptionsSendGift struct for SendGift().
//
// options include: `pay_for_upgrade`, `text`, `text_parse_mode`, and `text_entities`.
//
// https://core.telegram.org/bots/api#sendgift
type OptionsSendGift MethodOptions
// SetPayForUpgrade sets the `pay_for_upgrade` value of OptionsSendGift.
func (o OptionsSendGift) SetPayForUpgrade(payForUpgrade bool) OptionsSendGift {
o["pay_for_upgrade"] = payForUpgrade
return o
}
// SetText sets the `text` value of OptionsSendGift.
func (o OptionsSendGift) SetText(text string) OptionsSendGift {
o["text"] = text
return o
}
// SetTextParseMode sets the `text_parse_mode` value of OptionsSendGift.
func (o OptionsSendGift) SetTextParseMode(textParseMode string) OptionsSendGift {
o["text_parse_mode"] = textParseMode
return o
}
// SetTextEntities sets the `text_entities` value of OptionsSendGift.
func (o OptionsSendGift) SetTextEntities(textEntities []MessageEntity) OptionsSendGift {
o["text_entities"] = textEntities
return o
}
// OptionsVerifyUser struct for VerifyUser().
//
// options include: `custom_description`.
//
// https://core.telegram.org/bots/api#verifyuser
type OptionsVerifyUser MethodOptions
// SetCustomDescription sets the `custom_description` value of OptionsVerifyUser.
func (o OptionsVerifyUser) SetCustomDescription(customDescription string) OptionsVerifyUser {
o["custom_description"] = customDescription
return o
}
// OptionsVerifyChat struct for VerifyChat().
//
// options include: `custom_description`.
//
// https://core.telegram.org/bots/api#verifychat
type OptionsVerifyChat MethodOptions
// SetCustomDescription sets the `custom_description` value of OptionsVerifyChat.
func (o OptionsVerifyChat) SetCustomDescription(customDescription string) OptionsVerifyChat {
o["custom_description"] = customDescription
return o
}
// OptionsSendVideo struct for SendVideo().
//
// options include: `business_connection_id`, `message_thread_id`, `duration`, `width`, `height`, `thumbnail`, `caption`, `parse_mode`, `caption_entities`, `show_caption_above_media`, `has_spoiler`, `supports_streaming`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendvideo
type OptionsSendVideo MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendVideo.
func (o OptionsSendVideo) SetBusinessConnectionID(businessConnectionID string) OptionsSendVideo {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendVideo.
func (o OptionsSendVideo) SetMessageThreadID(messageThreadID int64) OptionsSendVideo {
o["message_thread_id"] = messageThreadID
return o
}
// SetDuration sets the `duration` value of OptionsSendVideo.
func (o OptionsSendVideo) SetDuration(duration int) OptionsSendVideo {
o["duration"] = duration
return o
}
// SetWidth sets the `width` value of OptionsSendVideo.
func (o OptionsSendVideo) SetWidth(width int) OptionsSendVideo {
o["width"] = width
return o
}
// SetHeight sets the `height` value of OptionsSendVideo.
func (o OptionsSendVideo) SetHeight(height int) OptionsSendVideo {
o["height"] = height
return o
}
// SetThumbnail sets the `thumbnail` value of OptionsSendVideo.
//
// `thumbnail` can be one of InputFile or string.
func (o OptionsSendVideo) SetThumbnail(thumbnail any) OptionsSendVideo {
o["thumbnail"] = thumbnail
return o
}
// SetCaption sets the `caption` value of OptionsSendVideo.
func (o OptionsSendVideo) SetCaption(caption string) OptionsSendVideo {
o["caption"] = caption
return o
}
// SetParseMode sets the `parse_mode` value of OptionsSendVideo.
func (o OptionsSendVideo) SetParseMode(parseMode ParseMode) OptionsSendVideo {
o["parse_mode"] = parseMode
return o
}
// SetCaptionEntities sets the `caption_entities` value of OptionsSendVideo.
func (o OptionsSendVideo) SetCaptionEntities(entities []MessageEntity) OptionsSendVideo {
o["caption_entities"] = entities
return o
}
// SetShowCaptionAboveMedia sets the `show_caption_above_media` value of OptionsSendVideo.
func (o OptionsSendVideo) SetShowCaptionAboveMedia(showCaptionAboveMedia bool) OptionsSendVideo {
o["show_caption_above_media"] = showCaptionAboveMedia
return o
}
// SetHasSpoiler sets the `has_spoiler` value of OptionsSendVideo.
func (o OptionsSendVideo) SetHasSpiler(hasSpoiler bool) OptionsSendVideo {
o["has_spoiler"] = hasSpoiler
return o
}
// SetSupportsStreaming sets the `supports_streaming` value of OptionsSendVideo.
func (o OptionsSendVideo) SetSupportsStreaming(supportsStreaming bool) OptionsSendVideo {
o["supports_streaming"] = supportsStreaming
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendVideo.
func (o OptionsSendVideo) SetDisableNotification(disable bool) OptionsSendVideo {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendVideo.
func (o OptionsSendVideo) SetProtectContent(protect bool) OptionsSendVideo {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendVideo.
func (o OptionsSendVideo) SetAllowPaidBroadcast(allow bool) OptionsSendVideo {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendVideo.
func (o OptionsSendVideo) SetMessageEffectID(messageEffectID string) OptionsSendVideo {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendVideo.
func (o OptionsSendVideo) SetReplyParameters(replyParameters ReplyParameters) OptionsSendVideo {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the `reply_markup` value of OptionsSendVideo.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendVideo) SetReplyMarkup(replyMarkup any) OptionsSendVideo {
o["reply_markup"] = replyMarkup
return o
}
// OptionsSendAnimation struct for SendAnimation().
//
// options include: `business_connection_id`, `message_thread_id`, `duration`, `width`, `height`, `thumbnail`, `caption`, `parse_mode`, `caption_entities`, `show_caption_above_media`, `has_spoiler`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendanimation
type OptionsSendAnimation MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetBusinessConnectionID(businessConnectionID string) OptionsSendAnimation {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetMessageThreadID(messageThreadID int64) OptionsSendAnimation {
o["message_thread_id"] = messageThreadID
return o
}
// SetDuration sets the `duration` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetDuration(duration int) OptionsSendAnimation {
o["duration"] = duration
return o
}
// SetWidth sets the `width` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetWidth(width int) OptionsSendAnimation {
o["width"] = width
return o
}
// SetHeight sets the `height` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetHeight(height int) OptionsSendAnimation {
o["height"] = height
return o
}
// SetThumbnail sets the `thumbnail` value of OptionsSendAnimation.
//
// `thumbnail` can be one of InputFile or string.
func (o OptionsSendAnimation) SetThumbnail(thumbnail any) OptionsSendAnimation {
o["thumbnail"] = thumbnail
return o
}
// SetCaption sets the `caption` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetCaption(caption string) OptionsSendAnimation {
o["caption"] = caption
return o
}
// SetParseMode sets the `parse_mode` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetParseMode(parseMode ParseMode) OptionsSendAnimation {
o["parse_mode"] = parseMode
return o
}
// SetCaptionEntities sets the `caption_entities` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetCaptionEntities(entities []MessageEntity) OptionsSendAnimation {
o["caption_entities"] = entities
return o
}
// SetShowCaptionAboveMedia sets the `show_caption_above_media` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetShowCaptionAboveMedia(showCaptionAboveMedia bool) OptionsSendAnimation {
o["show_caption_above_media"] = showCaptionAboveMedia
return o
}
// SetHasSpoiler sets the `has_spoiler` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetHasSpiler(hasSpoiler bool) OptionsSendAnimation {
o["has_spoiler"] = hasSpoiler
return o
}
// SetDisableNotification sets the `disable_notification` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetDisableNotification(disable bool) OptionsSendAnimation {
o["disable_notification"] = disable
return o
}
// SetProtectContent sets the `protect_content` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetProtectContent(protect bool) OptionsSendAnimation {
o["protect_content"] = protect
return o
}
// SetAllowPaidBroadcast sets the `allow_paid_broadcast` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetAllowPaidBroadcast(allow bool) OptionsSendAnimation {
o["allow_paid_broadcast"] = allow
return o
}
// SetMessageEffectID sets the `message_effect_id` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetMessageEffectID(messageEffectID string) OptionsSendAnimation {
o["message_effect_id"] = messageEffectID
return o
}
// SetReplyParameters sets the `reply_parameters` value of OptionsSendAnimation.
func (o OptionsSendAnimation) SetReplyParameters(replyParameters ReplyParameters) OptionsSendAnimation {
o["reply_parameters"] = replyParameters
return o
}
// SetReplyMarkup sets the `reply_markup` value of OptionsSendAnimation.
//
// `replyMarkup` can be one of InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, or ForceReply.
func (o OptionsSendAnimation) SetReplyMarkup(replyMarkup any) OptionsSendAnimation {
o["reply_markup"] = replyMarkup
return o
}
// OptionsSendVoice struct for SendVoice().
//
// options include: `business_connection_id`, `message_thread_id`, `caption`, `parse_mode`, `caption_entities`, `duration`, `disable_notification`, `protect_content`, `allow_paid_broadcast`, `message_effect_id`, `reply_parameters`, and `reply_markup`.
//
// https://core.telegram.org/bots/api#sendvoice
type OptionsSendVoice MethodOptions
// SetBusinessConnectionID sets the `business_connection_id` value of OptionsSendVoice.
func (o OptionsSendVoice) SetBusinessConnectionID(businessConnectionID string) OptionsSendVoice {
o["business_connection_id"] = businessConnectionID
return o
}
// SetMessageThreadID sets the `message_thread_id` value of OptionsSendVoice.
func (o OptionsSendVoice) SetMessageThreadID(messageThreadID int64) OptionsSendVoice {