-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
2925 lines (2695 loc) · 279 KB
/
Copy pathtypes.go
File metadata and controls
2925 lines (2695 loc) · 279 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
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
// Code generated by goram/internal/gen; DO NOT EDIT.
package goram
// This object represents an incoming update.
//
// At most one of the optional parameters can be present in any given update.
//
// https://core.telegram.org/bots/api#update
type Update struct {
UpdateID int64 `json:"update_id"` // The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
Message *Message `json:"message,omitempty"` // Optional. New incoming message of any kind - text, photo, sticker, etc.
EditedMessage *Message `json:"edited_message,omitempty"` // Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
ChannelPost *Message `json:"channel_post,omitempty"` // Optional. New incoming channel post of any kind - text, photo, sticker, etc.
EditedChannelPost *Message `json:"edited_channel_post,omitempty"` // Optional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
BusinessConnection *BusinessConnection `json:"business_connection,omitempty"` // Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
BusinessMessage *Message `json:"business_message,omitempty"` // Optional. New message from a connected business account
EditedBusinessMessage *Message `json:"edited_business_message,omitempty"` // Optional. New version of a message from a connected business account
DeletedBusinessMessages *BusinessMessagesDeleted `json:"deleted_business_messages,omitempty"` // Optional. Messages were deleted from a connected business account
MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"` // Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.
MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"` // Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.
InlineQuery *InlineQuery `json:"inline_query,omitempty"` // Optional. New incoming inline query
ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` // Optional. New incoming callback query
ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // Optional. New incoming shipping query. Only for invoices with flexible price
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Optional. New incoming pre-checkout query. Contains full information about checkout
PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"` // Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
Poll *Poll `json:"poll,omitempty"` // Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
PollAnswer *PollAnswer `json:"poll_answer,omitempty"` // Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"` // Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"` // Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.
ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"` // Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"` // Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` // Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.
}
// Describes the current status of a webhook.
//
// https://core.telegram.org/bots/api#webhookinfo
type WebhookInfo struct {
URL string `json:"url"` // Webhook URL, may be empty if webhook is not set up
HasCustomCertificate bool `json:"has_custom_certificate"` // True, if a custom certificate was provided for webhook certificate checks
PendingUpdateCount int `json:"pending_update_count"` // Number of updates awaiting delivery
IpAddress string `json:"ip_address,omitempty"` // Optional. Currently used webhook IP address
LastErrorDate int `json:"last_error_date,omitempty"` // Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
LastErrorMessage string `json:"last_error_message,omitempty"` // Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
LastSynchronizationErrorDate int `json:"last_synchronization_error_date,omitempty"` // Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
MaxConnections int `json:"max_connections,omitempty"` // Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` // Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
}
// This object represents a Telegram user or bot.
//
// https://core.telegram.org/bots/api#user
type User struct {
ID int64 `json:"id"` // Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
IsBot bool `json:"is_bot"` // True, if this user is a bot
FirstName string `json:"first_name"` // User's or bot's first name
LastName string `json:"last_name,omitempty"` // Optional. User's or bot's last name
Username string `json:"username,omitempty"` // Optional. User's or bot's username
LanguageCode string `json:"language_code,omitempty"` // Optional. IETF language tag of the user's language
IsPremium bool `json:"is_premium,omitempty"` // Optional. True, if this user is a Telegram Premium user
AddedToAttachmentMenu bool `json:"added_to_attachment_menu,omitempty"` // Optional. True, if this user added the bot to the attachment menu
CanJoinGroups bool `json:"can_join_groups,omitempty"` // Optional. True, if the bot can be invited to groups. Returned only in getMe.
CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"` // Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"` // Optional. True, if the bot supports inline queries. Returned only in getMe.
CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"` // Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.
HasMainWebApp bool `json:"has_main_web_app,omitempty"` // Optional. True, if the bot has a main Web App. Returned only in getMe.
HasTopicsEnabled bool `json:"has_topics_enabled,omitempty"` // Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.
AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics,omitempty"` // Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.
}
// This object represents a chat.
//
// https://core.telegram.org/bots/api#chat
type Chat struct {
ID int64 `json:"id"` // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Type ChatType `json:"type"` // Type of the chat, can be either "private", "group", "supergroup" or "channel"
Title string `json:"title,omitempty"` // Optional. Title, for supergroups, channels and group chats
Username string `json:"username,omitempty"` // Optional. Username, for private chats, supergroups and channels if available
FirstName string `json:"first_name,omitempty"` // Optional. First name of the other party in a private chat
LastName string `json:"last_name,omitempty"` // Optional. Last name of the other party in a private chat
IsForum bool `json:"is_forum,omitempty"` // Optional. True, if the supergroup chat is a forum (has topics enabled)
IsDirectMessages bool `json:"is_direct_messages,omitempty"` // Optional. True, if the chat is the direct messages chat of a channel
}
// This object contains full information about a chat.
//
// https://core.telegram.org/bots/api#chatfullinfo
type ChatFullInfo struct {
ID int64 `json:"id"` // Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Type ChatType `json:"type"` // Type of the chat, can be either "private", "group", "supergroup" or "channel"
Title string `json:"title,omitempty"` // Optional. Title, for supergroups, channels and group chats
Username string `json:"username,omitempty"` // Optional. Username, for private chats, supergroups and channels if available
FirstName string `json:"first_name,omitempty"` // Optional. First name of the other party in a private chat
LastName string `json:"last_name,omitempty"` // Optional. Last name of the other party in a private chat
IsForum bool `json:"is_forum,omitempty"` // Optional. True, if the supergroup chat is a forum (has topics enabled)
IsDirectMessages bool `json:"is_direct_messages,omitempty"` // Optional. True, if the chat is the direct messages chat of a channel
AccentColorID int64 `json:"accent_color_id"` // Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.
MaxReactionCount int `json:"max_reaction_count"` // The maximum number of reactions that can be set on a message in the chat
Photo *ChatPhoto `json:"photo,omitempty"` // Optional. Chat photo
ActiveUsernames []string `json:"active_usernames,omitempty"` // Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels
Birthdate *Birthdate `json:"birthdate,omitempty"` // Optional. For private chats, the date of birth of the user
BusinessIntro *BusinessIntro `json:"business_intro,omitempty"` // Optional. For private chats with business accounts, the intro of the business
BusinessLocation *BusinessLocation `json:"business_location,omitempty"` // Optional. For private chats with business accounts, the location of the business
BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"` // Optional. For private chats with business accounts, the opening hours of the business
PersonalChat *Chat `json:"personal_chat,omitempty"` // Optional. For private chats, the personal channel of the user
ParentChat *Chat `json:"parent_chat,omitempty"` // Optional. Information about the corresponding channel chat; for direct messages chats only
AvailableReactions []ReactionType `json:"available_reactions,omitempty"` // Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.
BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"` // Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
ProfileAccentColorID int64 `json:"profile_accent_color_id,omitempty"` // Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.
ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"` // Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background
EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` // Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat
EmojiStatusExpirationDate int `json:"emoji_status_expiration_date,omitempty"` // Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any
Bio string `json:"bio,omitempty"` // Optional. Bio of the other party in a private chat
HasPrivateForwards bool `json:"has_private_forwards,omitempty"` // Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user
HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"` // Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat
JoinToSendMessages bool `json:"join_to_send_messages,omitempty"` // Optional. True, if users need to join the supergroup before they can send messages
JoinByRequest bool `json:"join_by_request,omitempty"` // Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators
Description string `json:"description,omitempty"` // Optional. Description, for groups, supergroups and channel chats
InviteLink string `json:"invite_link,omitempty"` // Optional. Primary invite link, for groups, supergroups and channel chats
PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. The most recent pinned message (by sending date)
Permissions *ChatPermissions `json:"permissions,omitempty"` // Optional. Default chat member permissions, for groups and supergroups
AcceptedGiftTypes *AcceptedGiftTypes `json:"accepted_gift_types"` // Information about types of gifts that are accepted by the chat or by the corresponding user for private chats
CanSendPaidMedia bool `json:"can_send_paid_media,omitempty"` // Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
SlowModeDelay int `json:"slow_mode_delay,omitempty"` // Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds
UnrestrictBoostCount int `json:"unrestrict_boost_count,omitempty"` // Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions
MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"` // Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds
HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"` // Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.
HasHiddenMembers bool `json:"has_hidden_members,omitempty"` // Optional. True, if non-administrators can only get the list of bots and administrators in the chat
HasProtectedContent bool `json:"has_protected_content,omitempty"` // Optional. True, if messages from the chat can't be forwarded to other chats
HasVisibleHistory bool `json:"has_visible_history,omitempty"` // Optional. True, if new chat members will have access to old messages; available only to chat administrators
StickerSetName string `json:"sticker_set_name,omitempty"` // Optional. For supergroups, name of the group sticker set
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` // Optional. True, if the bot can change the group sticker set
CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"` // Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
LinkedChatID int64 `json:"linked_chat_id,omitempty"` // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
Location *ChatLocation `json:"location,omitempty"` // Optional. For supergroups, the location to which the supergroup is connected
Rating *UserRating `json:"rating,omitempty"` // Optional. For private chats, the rating of the user if any
FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"` // Optional. For private chats, the first audio added to the profile of the user
UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"` // Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews
PaidMessageStarCount int `json:"paid_message_star_count,omitempty"` // Optional. The number of Telegram Stars a general user have to pay to send a message to the chat
}
// This object represents a message.
//
// https://core.telegram.org/bots/api#message
type Message struct {
MessageID int `json:"message_id"` // Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
MessageThreadID int64 `json:"message_thread_id,omitempty"` // Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
DirectMessagesTopic *DirectMessagesTopic `json:"direct_messages_topic,omitempty"` // Optional. Information about the direct messages chat topic that contains the message
From *User `json:"from,omitempty"` // Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
SenderChat *Chat `json:"sender_chat,omitempty"` // Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
SenderBoostCount int `json:"sender_boost_count,omitempty"` // Optional. If the sender of the message boosted the chat, the number of boosts added by the user
SenderBusinessBot *User `json:"sender_business_bot,omitempty"` // Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.
SenderTag string `json:"sender_tag,omitempty"` // Optional. Tag or custom title of the sender of the message; for supergroups only
Date int `json:"date"` // Date the message was sent in Unix time. It is always a positive number, representing a valid date.
BusinessConnectionID string `json:"business_connection_id,omitempty"` // Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
Chat *Chat `json:"chat"` // Chat the message belongs to
ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"` // Optional. Information about the original message for forwarded messages
IsTopicMessage bool `json:"is_topic_message,omitempty"` // Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot
IsAutomaticForward bool `json:"is_automatic_forward,omitempty"` // Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
ReplyToMessage *Message `json:"reply_to_message,omitempty"` // Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"` // Optional. Information about the message that is being replied to, which may come from another chat or forum topic
Quote *TextQuote `json:"quote,omitempty"` // Optional. For replies that quote part of the original message, the quoted part of the message
ReplyToStory *Story `json:"reply_to_story,omitempty"` // Optional. For replies to a story, the original story
ReplyToChecklistTaskID int64 `json:"reply_to_checklist_task_id,omitempty"` // Optional. Identifier of the specific checklist task that is being replied to
ViaBot *User `json:"via_bot,omitempty"` // Optional. Bot through which the message was sent
EditDate int `json:"edit_date,omitempty"` // Optional. Date the message was last edited in Unix time
HasProtectedContent bool `json:"has_protected_content,omitempty"` // Optional. True, if the message can't be forwarded
IsFromOffline bool `json:"is_from_offline,omitempty"` // Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
IsPaidPost bool `json:"is_paid_post,omitempty"` // Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited.
MediaGroupID string `json:"media_group_id,omitempty"` // Optional. The unique identifier inside this chat of a media message group this message belongs to
AuthorSignature string `json:"author_signature,omitempty"` // Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
PaidStarCount int `json:"paid_star_count,omitempty"` // Optional. The number of Telegram Stars that were paid by the sender of the message to send it
Text string `json:"text,omitempty"` // Optional. For text messages, the actual UTF-8 text of the message
Entities []MessageEntity `json:"entities,omitempty"` // Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info,omitempty"` // Optional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited.
EffectID string `json:"effect_id,omitempty"` // Optional. Unique identifier of the message effect added to the message
Animation *Animation `json:"animation,omitempty"` // Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
Audio *Audio `json:"audio,omitempty"` // Optional. Message is an audio file, information about the file
Document *Document `json:"document,omitempty"` // Optional. Message is a general file, information about the file
PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"` // Optional. Message contains paid media; information about the paid media
Photo []PhotoSize `json:"photo,omitempty"` // Optional. Message is a photo, available sizes of the photo
Sticker *Sticker `json:"sticker,omitempty"` // Optional. Message is a sticker, information about the sticker
Story *Story `json:"story,omitempty"` // Optional. Message is a forwarded story
Video *Video `json:"video,omitempty"` // Optional. Message is a video, information about the video
VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a video note, information about the video message
Voice *Voice `json:"voice,omitempty"` // Optional. Message is a voice message, information about the file
Caption string `json:"caption,omitempty"` // Optional. Caption for the animation, audio, document, paid media, photo, video or voice
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. True, if the caption must be shown above the message media
HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"` // Optional. True, if the message media is covered by a spoiler animation
Checklist *Checklist `json:"checklist,omitempty"` // Optional. Message is a checklist
Contact *Contact `json:"contact,omitempty"` // Optional. Message is a shared contact, information about the contact
Dice *Dice `json:"dice,omitempty"` // Optional. Message is a dice with random value
Game *Game `json:"game,omitempty"` // Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games
Poll *Poll `json:"poll,omitempty"` // Optional. Message is a native poll, information about the poll
Venue *Venue `json:"venue,omitempty"` // Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
Location *Location `json:"location,omitempty"` // Optional. Message is a shared location, information about the location
NewChatMembers []User `json:"new_chat_members,omitempty"` // Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
LeftChatMember *User `json:"left_chat_member,omitempty"` // Optional. A member was removed from the group, information about them (this member may be the bot itself)
ChatOwnerLeft *ChatOwnerLeft `json:"chat_owner_left,omitempty"` // Optional. Service message: chat owner has left
ChatOwnerChanged *ChatOwnerChanged `json:"chat_owner_changed,omitempty"` // Optional. Service message: chat owner has changed
NewChatTitle string `json:"new_chat_title,omitempty"` // Optional. A chat title was changed to this value
NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"` // Optional. A chat photo was change to this value
DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"` // Optional. Service message: the chat photo was deleted
GroupChatCreated bool `json:"group_chat_created,omitempty"` // Optional. Service message: the group has been created
SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"` // Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
ChannelChatCreated bool `json:"channel_chat_created,omitempty"` // Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` // Optional. Service message: auto-delete timer settings changed in the chat
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"` // Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"` // Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
Invoice *Invoice `json:"invoice,omitempty"` // Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments
SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` // Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
RefundedPayment *RefundedPayment `json:"refunded_payment,omitempty"` // Optional. Message is a service message about a refunded payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments
UsersShared *UsersShared `json:"users_shared,omitempty"` // Optional. Service message: users were shared with the bot
ChatShared *ChatShared `json:"chat_shared,omitempty"` // Optional. Service message: a chat was shared with the bot
Gift *GiftInfo `json:"gift,omitempty"` // Optional. Service message: a regular gift was sent or received
UniqueGift *UniqueGiftInfo `json:"unique_gift,omitempty"` // Optional. Service message: a unique gift was sent or received
GiftUpgradeSent *GiftInfo `json:"gift_upgrade_sent,omitempty"` // Optional. Service message: upgrade of a gift was purchased after the gift was sent
ConnectedWebsite string `json:"connected_website,omitempty"` // Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login
WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` // Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess
PassportData *PassportData `json:"passport_data,omitempty"` // Optional. Telegram Passport data
ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"` // Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"` // Optional. Service message: user boosted the chat
ChatBackgroundSet *ChatBackground `json:"chat_background_set,omitempty"` // Optional. Service message: chat background set
ChecklistTasksDone *ChecklistTasksDone `json:"checklist_tasks_done,omitempty"` // Optional. Service message: some tasks in a checklist were marked as done or not done
ChecklistTasksAdded *ChecklistTasksAdded `json:"checklist_tasks_added,omitempty"` // Optional. Service message: tasks were added to a checklist
DirectMessagePriceChanged *DirectMessagePriceChanged `json:"direct_message_price_changed,omitempty"` // Optional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed
ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"` // Optional. Service message: forum topic created
ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"` // Optional. Service message: forum topic edited
ForumTopicClosed ForumTopicClosed `json:"forum_topic_closed,omitempty"` // Optional. Service message: forum topic closed
ForumTopicReopened ForumTopicReopened `json:"forum_topic_reopened,omitempty"` // Optional. Service message: forum topic reopened
GeneralForumTopicHidden GeneralForumTopicHidden `json:"general_forum_topic_hidden,omitempty"` // Optional. Service message: the 'General' forum topic hidden
GeneralForumTopicUnhidden GeneralForumTopicUnhidden `json:"general_forum_topic_unhidden,omitempty"` // Optional. Service message: the 'General' forum topic unhidden
GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"` // Optional. Service message: a scheduled giveaway was created
Giveaway *Giveaway `json:"giveaway,omitempty"` // Optional. The message is a scheduled giveaway message
GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` // Optional. A giveaway with public winners was completed
GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` // Optional. Service message: a giveaway without public winners was completed
PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"` // Optional. Service message: the price for paid messages has changed in the chat
SuggestedPostApproved *SuggestedPostApproved `json:"suggested_post_approved,omitempty"` // Optional. Service message: a suggested post was approved
SuggestedPostApprovalFailed *SuggestedPostApprovalFailed `json:"suggested_post_approval_failed,omitempty"` // Optional. Service message: approval of a suggested post has failed
SuggestedPostDeclined *SuggestedPostDeclined `json:"suggested_post_declined,omitempty"` // Optional. Service message: a suggested post was declined
SuggestedPostPaid *SuggestedPostPaid `json:"suggested_post_paid,omitempty"` // Optional. Service message: payment for a suggested post was received
SuggestedPostRefunded *SuggestedPostRefunded `json:"suggested_post_refunded,omitempty"` // Optional. Service message: payment for a suggested post was refunded
VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` // Optional. Service message: video chat scheduled
VideoChatStarted VideoChatStarted `json:"video_chat_started,omitempty"` // Optional. Service message: video chat started
VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"` // Optional. Service message: video chat ended
VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"` // Optional. Service message: new participants invited to a video chat
WebAppData *WebAppData `json:"web_app_data,omitempty"` // Optional. Service message: data sent by a Web App
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
}
// This object represents a unique message identifier.
//
// https://core.telegram.org/bots/api#messageid
type MessageId struct {
MessageID int `json:"message_id"` // Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
}
// This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
//
// https://core.telegram.org/bots/api#messageentity
type MessageEntity struct {
Type MessageEntityType `json:"type"` // Type of the entity. Currently, can be "mention" (@username), "hashtag" (#hashtag or #hashtag@chatusername), "cashtag" ($USD or $USD@chatusername), "bot_command" (/start@jobs_bot), "url" (https://telegram.org), "email" (do-not-reply@telegram.org), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "blockquote" (block quotation), "expandable_blockquote" (collapsed-by-default block quotation), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames), "custom_emoji" (for inline custom emoji stickers), or "date_time" (for formatted date and time)
Offset int64 `json:"offset"` // Offset in UTF-16 code units to the start of the entity
Length int `json:"length"` // Length of the entity in UTF-16 code units
URL string `json:"url,omitempty"` // Optional. For "text_link" only, URL that will be opened after user taps on the text
User *User `json:"user,omitempty"` // Optional. For "text_mention" only, the mentioned user
Language string `json:"language,omitempty"` // Optional. For "pre" only, the programming language of the entity text
CustomEmojiID string `json:"custom_emoji_id,omitempty"` // Optional. For "custom_emoji" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
UnixTime int `json:"unix_time,omitempty"` // Optional. For "date_time" only, the Unix time associated with the entity
DateTimeFormat string `json:"date_time_format,omitempty"` // Optional. For "date_time" only, the string that defines the formatting of the date and time. See date-time entity formatting for more details.
}
// This object contains information about the quoted part of a message that is replied to by the given message.
//
// https://core.telegram.org/bots/api#textquote
type TextQuote struct {
Text string `json:"text"` // Text of the quoted part of a message that is replied to by the given message
Entities []MessageEntity `json:"entities,omitempty"` // Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.
Position int `json:"position"` // Approximate quote position in the original message in UTF-16 code units as specified by the sender
IsManual bool `json:"is_manual,omitempty"` // Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.
}
// This object contains information about a message that is being replied to, which may come from another chat or forum topic.
//
// https://core.telegram.org/bots/api#externalreplyinfo
type ExternalReplyInfo struct {
Origin *MessageOrigin `json:"origin"` // Origin of the message replied to by the given message
Chat *Chat `json:"chat,omitempty"` // Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
MessageID int `json:"message_id,omitempty"` // Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Optional. Options used for link preview generation for the original message, if it is a text message
Animation *Animation `json:"animation,omitempty"` // Optional. Message is an animation, information about the animation
Audio *Audio `json:"audio,omitempty"` // Optional. Message is an audio file, information about the file
Document *Document `json:"document,omitempty"` // Optional. Message is a general file, information about the file
PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"` // Optional. Message contains paid media; information about the paid media
Photo []PhotoSize `json:"photo,omitempty"` // Optional. Message is a photo, available sizes of the photo
Sticker *Sticker `json:"sticker,omitempty"` // Optional. Message is a sticker, information about the sticker
Story *Story `json:"story,omitempty"` // Optional. Message is a forwarded story
Video *Video `json:"video,omitempty"` // Optional. Message is a video, information about the video
VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a video note, information about the video message
Voice *Voice `json:"voice,omitempty"` // Optional. Message is a voice message, information about the file
HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"` // Optional. True, if the message media is covered by a spoiler animation
Checklist *Checklist `json:"checklist,omitempty"` // Optional. Message is a checklist
Contact *Contact `json:"contact,omitempty"` // Optional. Message is a shared contact, information about the contact
Dice *Dice `json:"dice,omitempty"` // Optional. Message is a dice with random value
Game *Game `json:"game,omitempty"` // Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games
Giveaway *Giveaway `json:"giveaway,omitempty"` // Optional. Message is a scheduled giveaway, information about the giveaway
GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` // Optional. A giveaway with public winners was completed
Invoice *Invoice `json:"invoice,omitempty"` // Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments
Location *Location `json:"location,omitempty"` // Optional. Message is a shared location, information about the location
Poll *Poll `json:"poll,omitempty"` // Optional. Message is a native poll, information about the poll
Venue *Venue `json:"venue,omitempty"` // Optional. Message is a venue, information about the venue
}
// Describes reply parameters for the message that is being sent.
//
// https://core.telegram.org/bots/api#replyparameters
type ReplyParameters struct {
MessageID int `json:"message_id"` // Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
ChatID ChatID `json:"chat_id,omitempty"` // Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats.
AllowSendingWithoutReply bool `json:"allow_sending_without_reply,omitempty"` // Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.
Quote string `json:"quote,omitempty"` // Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message.
QuoteParseMode string `json:"quote_parse_mode,omitempty"` // Optional. Mode for parsing entities in the quote. See formatting options for more details.
QuoteEntities []MessageEntity `json:"quote_entities,omitempty"` // Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
QuotePosition int `json:"quote_position,omitempty"` // Optional. Position of the quote in the original message in UTF-16 code units
ChecklistTaskID int64 `json:"checklist_task_id,omitempty"` // Optional. Identifier of the specific checklist task to be replied to
}
// This object describes the origin of a message. It can be one of
//
// - MessageOriginUser
//
// - MessageOriginHiddenUser
//
// - MessageOriginChat
//
// - MessageOriginChannel
//
// https://core.telegram.org/bots/api#messageorigin
type MessageOrigin struct {
Type string `json:"type"`
Date int `json:"date"` // Date the message was sent originally in Unix time
SenderUser *User `json:"sender_user"` // User that sent the message originally
SenderUserName string `json:"sender_user_name"` // Name of the user that sent the message originally
SenderChat *Chat `json:"sender_chat"` // Chat that sent the message originally
AuthorSignature string `json:"author_signature,omitempty"` // Optional. For messages originally sent by an anonymous chat administrator, original message author signature
Chat *Chat `json:"chat"` // Channel chat to which the message was originally sent
MessageID int `json:"message_id"` // Unique message identifier inside the chat
}
// This object represents one size of a photo or a file / sticker thumbnail.
//
// https://core.telegram.org/bots/api#photosize
type PhotoSize struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Width int `json:"width"` // Photo width
Height int `json:"height"` // Photo height
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes
}
// This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
//
// https://core.telegram.org/bots/api#animation
type Animation struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Width int `json:"width"` // Video width as defined by the sender
Height int `json:"height"` // Video height as defined by the sender
Duration int `json:"duration"` // Duration of the video in seconds as defined by the sender
Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Animation thumbnail as defined by the sender
FileName string `json:"file_name,omitempty"` // Optional. Original animation filename as defined by the sender
MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
}
// This object represents an audio file to be treated as music by the Telegram clients.
//
// https://core.telegram.org/bots/api#audio
type Audio struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Duration int `json:"duration"` // Duration of the audio in seconds as defined by the sender
Performer string `json:"performer,omitempty"` // Optional. Performer of the audio as defined by the sender or by audio tags
Title string `json:"title,omitempty"` // Optional. Title of the audio as defined by the sender or by audio tags
FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by the sender
MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs
}
// This object represents a general file (as opposed to photos, voice messages and audio files).
//
// https://core.telegram.org/bots/api#document
type Document struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Document thumbnail as defined by the sender
FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by the sender
MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
}
// This object represents a story.
//
// https://core.telegram.org/bots/api#story
type Story struct {
Chat *Chat `json:"chat"` // Chat that posted the story
ID int64 `json:"id"` // Unique identifier for the story in the chat
}
// This object represents a video file of a specific quality.
//
// https://core.telegram.org/bots/api#videoquality
type VideoQuality struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Width int `json:"width"` // Video width
Height int `json:"height"` // Video height
Codec string `json:"codec"` // Codec that was used to encode the video, for example, "h264", "h265", or "av01"
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
}
// This object represents a video file.
//
// https://core.telegram.org/bots/api#video
type Video struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Width int `json:"width"` // Video width as defined by the sender
Height int `json:"height"` // Video height as defined by the sender
Duration int `json:"duration"` // Duration of the video in seconds as defined by the sender
Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Video thumbnail
Cover []PhotoSize `json:"cover,omitempty"` // Optional. Available sizes of the cover of the video in the message
StartTimestamp int `json:"start_timestamp,omitempty"` // Optional. Timestamp in seconds from which the video will play in the message
Qualities []VideoQuality `json:"qualities,omitempty"` // Optional. List of available qualities of the video
FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by the sender
MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
}
// This object represents a video message (available in Telegram apps as of v.4.0).
//
// https://core.telegram.org/bots/api#videonote
type VideoNote struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Length int `json:"length"` // Video width and height (diameter of the video message) as defined by the sender
Duration int `json:"duration"` // Duration of the video in seconds as defined by the sender
Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Video thumbnail
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes
}
// This object represents a voice note.
//
// https://core.telegram.org/bots/api#voice
type Voice struct {
FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file
FileUniqueID string `json:"file_unique_id"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
Duration int `json:"duration"` // Duration of the audio in seconds as defined by the sender
MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender
FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
}
// Describes the paid media added to a message.
//
// https://core.telegram.org/bots/api#paidmediainfo
type PaidMediaInfo struct {
StarCount int `json:"star_count"` // The number of Telegram Stars that must be paid to buy access to the media
PaidMedia []PaidMedia `json:"paid_media"` // Information about the paid media
}
// This object describes paid media. Currently, it can be one of
//
// - PaidMediaPreview
//
// - PaidMediaPhoto
//
// - PaidMediaVideo
//
// https://core.telegram.org/bots/api#paidmedia
type PaidMedia struct {
Type string `json:"type"`
Width int `json:"width,omitempty"` // Optional. Media width as defined by the sender
Height int `json:"height,omitempty"` // Optional. Media height as defined by the sender
Duration int `json:"duration,omitempty"` // Optional. Duration of the media in seconds as defined by the sender
Photo []PhotoSize `json:"photo"` // The photo
Video *Video `json:"video"` // The video
}
// This object represents a phone contact.
//
// https://core.telegram.org/bots/api#contact
type Contact struct {
PhoneNumber string `json:"phone_number"` // Contact's phone number
FirstName string `json:"first_name"` // Contact's first name
LastName string `json:"last_name,omitempty"` // Optional. Contact's last name
UserID int64 `json:"user_id,omitempty"` // Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard
}
// This object represents an animated emoji that displays a random value.
//
// https://core.telegram.org/bots/api#dice
type Dice struct {
Emoji string `json:"emoji"` // Emoji on which the dice throw animation is based
Value int `json:"value"` // Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji
}
// This object contains information about one answer option in a poll.
//
// https://core.telegram.org/bots/api#polloption
type PollOption struct {
Text string `json:"text"` // Option text, 1-100 characters
TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
VoterCount int `json:"voter_count"` // Number of users that voted for this option
}
// This object contains information about one answer option in a poll to be sent.
//
// https://core.telegram.org/bots/api#inputpolloption
type InputPollOption struct {
Text string `json:"text"` // Option text, 1-100 characters
TextParseMode string `json:"text_parse_mode,omitempty"` // Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed
TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode
}
// This object represents an answer of a user in a non-anonymous poll.
//
// https://core.telegram.org/bots/api#pollanswer
type PollAnswer struct {
PollID string `json:"poll_id"` // Unique poll identifier
VoterChat *Chat `json:"voter_chat,omitempty"` // Optional. The chat that changed the answer to the poll, if the voter is anonymous
User *User `json:"user,omitempty"` // Optional. The user that changed the answer to the poll, if the voter isn't anonymous
OptionIds []int `json:"option_ids"` // 0-based identifiers of chosen answer options. May be empty if the vote was retracted.
}
// This object contains information about a poll.
//
// https://core.telegram.org/bots/api#poll
type Poll struct {
ID string `json:"id"` // Unique poll identifier
Question string `json:"question"` // Poll question, 1-300 characters
QuestionEntities []MessageEntity `json:"question_entities,omitempty"` // Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
Options []PollOption `json:"options"` // List of poll options
TotalVoterCount int `json:"total_voter_count"` // Total number of users that voted in the poll
IsClosed bool `json:"is_closed"` // True, if the poll is closed
IsAnonymous bool `json:"is_anonymous"` // True, if the poll is anonymous
Type string `json:"type"` // Poll type, currently can be "regular" or "quiz"
AllowsMultipleAnswers bool `json:"allows_multiple_answers"` // True, if the poll allows multiple answers
CorrectOptionID int64 `json:"correct_option_id,omitempty"` // Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
Explanation string `json:"explanation,omitempty"` // Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` // Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
OpenPeriod int `json:"open_period,omitempty"` // Optional. Amount of time in seconds the poll will be active after creation
CloseDate int `json:"close_date,omitempty"` // Optional. Point in time (Unix timestamp) when the poll will be automatically closed
}
// Describes a task in a checklist.
//
// https://core.telegram.org/bots/api#checklisttask
type ChecklistTask struct {
ID int64 `json:"id"` // Unique identifier of the task
Text string `json:"text"` // Text of the task
TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. Special entities that appear in the task text
CompletedByUser *User `json:"completed_by_user,omitempty"` // Optional. User that completed the task; omitted if the task wasn't completed by a user
CompletedByChat *Chat `json:"completed_by_chat,omitempty"` // Optional. Chat that completed the task; omitted if the task wasn't completed by a chat
CompletionDate int `json:"completion_date,omitempty"` // Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed
}
// Describes a checklist.
//
// https://core.telegram.org/bots/api#checklist
type Checklist struct {
Title string `json:"title"` // Title of the checklist
TitleEntities []MessageEntity `json:"title_entities,omitempty"` // Optional. Special entities that appear in the checklist title
Tasks []ChecklistTask `json:"tasks"` // List of tasks in the checklist
OthersCanAddTasks bool `json:"others_can_add_tasks,omitempty"` // Optional. True, if users other than the creator of the list can add tasks to the list
OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"` // Optional. True, if users other than the creator of the list can mark tasks as done or not done
}
// Describes a task to add to a checklist.
//
// https://core.telegram.org/bots/api#inputchecklisttask
type InputChecklistTask struct {
ID int64 `json:"id"` // Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist
Text string `json:"text"` // Text of the task; 1-100 characters after entities parsing
ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the text. See formatting options for more details.
TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed.
}
// Describes a checklist to create.
//
// https://core.telegram.org/bots/api#inputchecklist
type InputChecklist struct {
Title string `json:"title"` // Title of the checklist; 1-255 characters after entities parsing
ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the title. See formatting options for more details.
TitleEntities []MessageEntity `json:"title_entities,omitempty"` // Optional. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed.
Tasks []InputChecklistTask `json:"tasks"` // List of 1-30 tasks in the checklist
OthersCanAddTasks bool `json:"others_can_add_tasks,omitempty"` // Optional. Pass True if other users can add tasks to the checklist
OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"` // Optional. Pass True if other users can mark tasks as done or not done in the checklist
}
// Describes a service message about checklist tasks marked as done or not done.
//
// https://core.telegram.org/bots/api#checklisttasksdone
type ChecklistTasksDone struct {
ChecklistMessage *Message `json:"checklist_message,omitempty"` // Optional. Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
MarkedAsDoneTaskIds []int `json:"marked_as_done_task_ids,omitempty"` // Optional. Identifiers of the tasks that were marked as done
MarkedAsNotDoneTaskIds []int `json:"marked_as_not_done_task_ids,omitempty"` // Optional. Identifiers of the tasks that were marked as not done
}
// Describes a service message about tasks added to a checklist.
//
// https://core.telegram.org/bots/api#checklisttasksadded
type ChecklistTasksAdded struct {
ChecklistMessage *Message `json:"checklist_message,omitempty"` // Optional. Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
Tasks []ChecklistTask `json:"tasks"` // List of tasks added to the checklist
}
// This object represents a point on the map.
//
// https://core.telegram.org/bots/api#location
type Location struct {
Latitude float64 `json:"latitude"` // Latitude as defined by the sender
Longitude float64 `json:"longitude"` // Longitude as defined by the sender
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500
LivePeriod int `json:"live_period,omitempty"` // Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
Heading int `json:"heading,omitempty"` // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` // Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
}
// This object represents a venue.
//
// https://core.telegram.org/bots/api#venue
type Venue struct {
Location *Location `json:"location"` // Venue location. Can't be a live location
Title string `json:"title"` // Name of the venue
Address string `json:"address"` // Address of the venue
FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue
FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)
GooglePlaceID string `json:"google_place_id,omitempty"` // Optional. Google Places identifier of the venue
GooglePlaceType string `json:"google_place_type,omitempty"` // Optional. Google Places type of the venue. (See supported types.)
}
// Describes data sent from a Web App to the bot.
//
// https://core.telegram.org/bots/api#webappdata
type WebAppData struct {
Data string `json:"data"` // The data. Be aware that a bad client can send arbitrary data in this field.
ButtonText string `json:"button_text"` // Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.
}
// This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
//
// https://core.telegram.org/bots/api#proximityalerttriggered
type ProximityAlertTriggered struct {
Traveler *User `json:"traveler"` // User that triggered the alert
Watcher *User `json:"watcher"` // User that set the alert
Distance int `json:"distance"` // The distance between the users
}
// This object represents a service message about a change in auto-delete timer settings.
//
// https://core.telegram.org/bots/api#messageautodeletetimerchanged
type MessageAutoDeleteTimerChanged struct {
MessageAutoDeleteTime int `json:"message_auto_delete_time"` // New auto-delete time for messages in the chat; in seconds
}
// This object represents a service message about a user boosting a chat.
//
// https://core.telegram.org/bots/api#chatboostadded
type ChatBoostAdded struct {
BoostCount int `json:"boost_count"` // Number of boosts added by the user
}
// This object describes the way a background is filled based on the selected colors. Currently, it can be one of
//
// - BackgroundFillSolid
//
// - BackgroundFillGradient
//
// - BackgroundFillFreeformGradient
//
// https://core.telegram.org/bots/api#backgroundfill
type BackgroundFill struct {
Type string `json:"type"`
Color int `json:"color"` // The color of the background fill in the RGB24 format
TopColor int `json:"top_color"` // Top color of the gradient in the RGB24 format
BottomColor int `json:"bottom_color"` // Bottom color of the gradient in the RGB24 format
RotationAngle int `json:"rotation_angle"` // Clockwise rotation angle of the background fill in degrees; 0-359
Colors []int `json:"colors"` // A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format
}
// This object describes the type of a background. Currently, it can be one of
//
// - BackgroundTypeFill
//
// - BackgroundTypeWallpaper
//
// - BackgroundTypePattern
//
// - BackgroundTypeChatTheme
//
// https://core.telegram.org/bots/api#backgroundtype
type BackgroundType struct {
Type string `json:"type"`
Fill *BackgroundFill `json:"fill"` // The background fill
DarkThemeDimming int `json:"dark_theme_dimming"` // Dimming of the background in dark themes, as a percentage; 0-100
Document *Document `json:"document"` // Document with the wallpaper
IsBlurred bool `json:"is_blurred,omitempty"` // Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
IsMoving bool `json:"is_moving,omitempty"` // Optional. True, if the background moves slightly when the device is tilted
Intensity int `json:"intensity"` // Intensity of the pattern when it is shown above the filled background; 0-100
IsInverted bool `json:"is_inverted,omitempty"` // Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
ThemeName string `json:"theme_name"` // Name of the chat theme, which is usually an emoji
}
// This object represents a chat background.
//
// https://core.telegram.org/bots/api#chatbackground
type ChatBackground struct {
Type *BackgroundType `json:"type"` // Type of the background
}
// This object represents a service message about a new forum topic created in the chat.
//
// https://core.telegram.org/bots/api#forumtopiccreated
type ForumTopicCreated struct {
Name string `json:"name"` // Name of the topic
IconColor int `json:"icon_color"` // Color of the topic icon in RGB format
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Optional. Unique identifier of the custom emoji shown as the topic icon
IsNameImplicit bool `json:"is_name_implicit,omitempty"` // Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
}
// This object represents a service message about a forum topic closed in the chat. Currently holds no information.
//
// https://core.telegram.org/bots/api#forumtopicclosed
type ForumTopicClosed interface{}
// This object represents a service message about an edited forum topic.
//
// https://core.telegram.org/bots/api#forumtopicedited
type ForumTopicEdited struct {
Name string `json:"name,omitempty"` // Optional. New name of the topic, if it was edited
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed
}
// This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
//
// https://core.telegram.org/bots/api#forumtopicreopened
type ForumTopicReopened interface{}
// This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
//
// https://core.telegram.org/bots/api#generalforumtopichidden
type GeneralForumTopicHidden interface{}
// This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
//
// https://core.telegram.org/bots/api#generalforumtopicunhidden
type GeneralForumTopicUnhidden interface{}
// This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
//
// https://core.telegram.org/bots/api#shareduser
type SharedUser struct {
UserID int64 `json:"user_id"` // Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
FirstName string `json:"first_name,omitempty"` // Optional. First name of the user, if the name was requested by the bot
LastName string `json:"last_name,omitempty"` // Optional. Last name of the user, if the name was requested by the bot
Username string `json:"username,omitempty"` // Optional. Username of the user, if the username was requested by the bot
Photo []PhotoSize `json:"photo,omitempty"` // Optional. Available sizes of the chat photo, if the photo was requested by the bot
}
// This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
//
// https://core.telegram.org/bots/api#usersshared
type UsersShared struct {
RequestID int64 `json:"request_id"` // Identifier of the request
Users []SharedUser `json:"users"` // Information about users shared with the bot.
}
// This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
//
// https://core.telegram.org/bots/api#chatshared
type ChatShared struct {
RequestID int64 `json:"request_id"` // Identifier of the request
ChatID int64 `json:"chat_id"` // Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
Title string `json:"title,omitempty"` // Optional. Title of the chat, if the title was requested by the bot.
Username string `json:"username,omitempty"` // Optional. Username of the chat, if the username was requested by the bot and available.
Photo []PhotoSize `json:"photo,omitempty"` // Optional. Available sizes of the chat photo, if the photo was requested by the bot
}
// This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
//
// https://core.telegram.org/bots/api#writeaccessallowed
type WriteAccessAllowed struct {
FromRequest bool `json:"from_request,omitempty"` // Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess
WebAppName string `json:"web_app_name,omitempty"` // Optional. Name of the Web App, if the access was granted when the Web App was launched from a link
FromAttachmentMenu bool `json:"from_attachment_menu,omitempty"` // Optional. True, if the access was granted when the bot was added to the attachment or side menu
}
// This object represents a service message about a video chat scheduled in the chat.
//
// https://core.telegram.org/bots/api#videochatscheduled
type VideoChatScheduled struct {
StartDate int `json:"start_date"` // Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
}
// This object represents a service message about a video chat started in the chat. Currently holds no information.
//
// https://core.telegram.org/bots/api#videochatstarted
type VideoChatStarted interface{}
// This object represents a service message about a video chat ended in the chat.
//
// https://core.telegram.org/bots/api#videochatended
type VideoChatEnded struct {
Duration int `json:"duration"` // Video chat duration in seconds
}
// This object represents a service message about new members invited to a video chat.
//
// https://core.telegram.org/bots/api#videochatparticipantsinvited
type VideoChatParticipantsInvited struct {
Users []User `json:"users"` // New members that were invited to the video chat
}
// Describes a service message about a change in the price of paid messages within a chat.
//
// https://core.telegram.org/bots/api#paidmessagepricechanged
type PaidMessagePriceChanged struct {
PaidMessageStarCount int `json:"paid_message_star_count"` // The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
}
// Describes a service message about a change in the price of direct messages sent to a channel chat.
//
// https://core.telegram.org/bots/api#directmessagepricechanged
type DirectMessagePriceChanged struct {
AreDirectMessagesEnabled bool `json:"are_direct_messages_enabled"` // True, if direct messages are enabled for the channel chat; false otherwise
DirectMessageStarCount int `json:"direct_message_star_count,omitempty"` // Optional. The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0.
}
// Describes a service message about the approval of a suggested post.
//
// https://core.telegram.org/bots/api#suggestedpostapproved
type SuggestedPostApproved struct {
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` // Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
Price *SuggestedPostPrice `json:"price,omitempty"` // Optional. Amount paid for the post
SendDate int `json:"send_date"` // Date when the post will be published
}
// Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.
//
// https://core.telegram.org/bots/api#suggestedpostapprovalfailed
type SuggestedPostApprovalFailed struct {
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` // Optional. Message containing the suggested post whose approval has failed. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
Price *SuggestedPostPrice `json:"price"` // Expected price of the post
}
// Describes a service message about the rejection of a suggested post.
//
// https://core.telegram.org/bots/api#suggestedpostdeclined
type SuggestedPostDeclined struct {
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` // Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
Comment string `json:"comment,omitempty"` // Optional. Comment with which the post was declined
}
// Describes a service message about a successful payment for a suggested post.
//
// https://core.telegram.org/bots/api#suggestedpostpaid
type SuggestedPostPaid struct {
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` // Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
Currency string `json:"currency"` // Currency in which the payment was made. Currently, one of "XTR" for Telegram Stars or "TON" for toncoins
Amount int `json:"amount,omitempty"` // Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only
StarAmount *StarAmount `json:"star_amount,omitempty"` // Optional. The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only
}
// Describes a service message about a payment refund for a suggested post.
//
// https://core.telegram.org/bots/api#suggestedpostrefunded
type SuggestedPostRefunded struct {
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` // Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
Reason string `json:"reason"` // Reason for the refund. Currently, one of "post_deleted" if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or "payment_refunded" if the payer refunded their payment.
}
// This object represents a service message about the creation of a scheduled giveaway.
//
// https://core.telegram.org/bots/api#giveawaycreated
type GiveawayCreated struct {
PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
}
// This object represents a message about a scheduled giveaway.
//
// https://core.telegram.org/bots/api#giveaway
type Giveaway struct {
Chats []Chat `json:"chats"` // The list of chats which the user must join to participate in the giveaway
WinnersSelectionDate int `json:"winners_selection_date"` // Point in time (Unix timestamp) when winners of the giveaway will be selected
WinnerCount int `json:"winner_count"` // The number of users which are supposed to be selected as winners of the giveaway
OnlyNewMembers bool `json:"only_new_members,omitempty"` // Optional. True, if only users who join the chats after the giveaway started should be eligible to win
HasPublicWinners bool `json:"has_public_winners,omitempty"` // Optional. True, if the list of giveaway winners will be visible to everyone
PrizeDescription string `json:"prize_description,omitempty"` // Optional. Description of additional giveaway prize
CountryCodes []string `json:"country_codes,omitempty"` // Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.
PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` // Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
}
// This object represents a message about the completion of a giveaway with public winners.
//
// https://core.telegram.org/bots/api#giveawaywinners
type GiveawayWinners struct {
Chat *Chat `json:"chat"` // The chat that created the giveaway
GiveawayMessageID int64 `json:"giveaway_message_id"` // Identifier of the message with the giveaway in the chat
WinnersSelectionDate int `json:"winners_selection_date"` // Point in time (Unix timestamp) when winners of the giveaway were selected
WinnerCount int `json:"winner_count"` // Total number of winners in the giveaway
Winners []User `json:"winners"` // List of up to 100 winners of the giveaway
AdditionalChatCount int `json:"additional_chat_count,omitempty"` // Optional. The number of other chats the user had to join in order to be eligible for the giveaway
PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` // Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` // Optional. Number of undistributed prizes
OnlyNewMembers bool `json:"only_new_members,omitempty"` // Optional. True, if only users who had joined the chats after the giveaway started were eligible to win
WasRefunded bool `json:"was_refunded,omitempty"` // Optional. True, if the giveaway was canceled because the payment for it was refunded
PrizeDescription string `json:"prize_description,omitempty"` // Optional. Description of additional giveaway prize
}
// This object represents a service message about the completion of a giveaway without public winners.
//
// https://core.telegram.org/bots/api#giveawaycompleted
type GiveawayCompleted struct {
WinnerCount int `json:"winner_count"` // Number of winners in the giveaway
UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` // Optional. Number of undistributed prizes
GiveawayMessage *Message `json:"giveaway_message,omitempty"` // Optional. Message with the giveaway that was completed, if it wasn't deleted
IsStarGiveaway bool `json:"is_star_giveaway,omitempty"` // Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.
}
// Describes the options used for link preview generation.
//
// https://core.telegram.org/bots/api#linkpreviewoptions
type LinkPreviewOptions struct {
IsDisabled bool `json:"is_disabled,omitempty"` // Optional. True, if the link preview is disabled
URL string `json:"url,omitempty"` // Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
PreferSmallMedia bool `json:"prefer_small_media,omitempty"` // Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
PreferLargeMedia bool `json:"prefer_large_media,omitempty"` // Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
ShowAboveText bool `json:"show_above_text,omitempty"` // Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
}
// Describes the price of a suggested post.
//
// https://core.telegram.org/bots/api#suggestedpostprice
type SuggestedPostPrice struct {
Currency string `json:"currency"` // Currency in which the post will be paid. Currently, must be one of "XTR" for Telegram Stars or "TON" for toncoins
Amount int `json:"amount"` // The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000.
}
// Contains information about a suggested post.
//
// https://core.telegram.org/bots/api#suggestedpostinfo
type SuggestedPostInfo struct {
State string `json:"state"` // State of the suggested post. Currently, it can be one of "pending", "approved", "declined".
Price *SuggestedPostPrice `json:"price,omitempty"` // Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.
SendDate int `json:"send_date,omitempty"` // Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.
}
// Contains parameters of a post that is being suggested by the bot.
//
// https://core.telegram.org/bots/api#suggestedpostparameters
type SuggestedPostParameters struct {
Price *SuggestedPostPrice `json:"price,omitempty"` // Optional. Proposed price for the post. If the field is omitted, then the post is unpaid.
SendDate int `json:"send_date,omitempty"` // Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it.
}
// Describes a topic of a direct messages chat.
//
// https://core.telegram.org/bots/api#directmessagestopic
type DirectMessagesTopic struct {
TopicID int64 `json:"topic_id"` // Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
User *User `json:"user,omitempty"` // Optional. Information about the user that created the topic. Currently, it is always present
}
// This object represent a user's profile pictures.
//
// https://core.telegram.org/bots/api#userprofilephotos
type UserProfilePhotos struct {
TotalCount int `json:"total_count"` // Total number of profile pictures the target user has
Photos [][]PhotoSize `json:"photos"` // Requested profile pictures (in up to 4 sizes each)
}
// This object represents the audios displayed on a user's profile.
//
// https://core.telegram.org/bots/api#userprofileaudios
type UserProfileAudios struct {
TotalCount int `json:"total_count"` // Total number of profile audios for the target user
Audios []Audio `json:"audios"` // Requested profile audios
}
// This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
//