@@ -96,6 +96,18 @@ type Update struct {
9696 //
9797 // optional
9898 PollAnswer * PollAnswer `json:"poll_answer,omitempty"`
99+ // MyChatMember is the bot's chat member status was updated in a chat. For
100+ // private chats, this update is received only when the bot is blocked or
101+ // unblocked by the user.
102+ //
103+ // optional
104+ MyChatMember * ChatMemberUpdated `json:"my_chat_member"`
105+ // ChatMember is a chat member's status was updated in a chat. The bot must
106+ // be an administrator in the chat and must explicitly specify "chat_member"
107+ // in the list of allowed_updates to receive these updates.
108+ //
109+ // optional
110+ ChatMember * ChatMemberUpdated `json:"chat_member"`
99111}
100112
101113// UpdatesChannel is the channel for getting updates.
@@ -463,6 +475,11 @@ type Message struct {
463475 //
464476 // optional
465477 ChannelChatCreated bool `json:"channel_chat_created,omitempty"`
478+ // MessageAutoDeleteTimerChanged is a service message: auto-delete timer
479+ // settings changed in the chat.
480+ //
481+ // optional
482+ MessageAutoDeleteTimerChanged * MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed"`
466483 // MigrateToChatID is the group has been migrated to a supergroup with the specified identifier.
467484 // This number may be greater than 32 bits and some programming languages
468485 // may have difficulty/silent defects in interpreting it.
@@ -508,6 +525,19 @@ type Message struct {
508525 //
509526 // optional
510527 ProximityAlertTriggered * ProximityAlertTriggered `json:"proximity_alert_triggered"`
528+ // VoiceChatStarted is a service message: voice chat started.
529+ //
530+ // optional
531+ VoiceChatStarted * VoiceChatStarted `json:"voice_chat_started"`
532+ // VoiceChatEnded is a service message: voice chat ended.
533+ //
534+ // optional
535+ VoiceChatEnded * VoiceChatEnded `json:"voice_chat_ended"`
536+ // VoiceChatParticipantsInvited is a service message: new participants
537+ // invited to a voice chat.
538+ //
539+ // optional
540+ VoiceChatParticipantsInvited * VoiceChatParticipantsInvited `json:"voice_chat_participants_invited"`
511541 // ReplyMarkup is the Inline keyboard attached to the message.
512542 // login_url buttons are represented as ordinary url buttons.
513543 //
@@ -1037,6 +1067,33 @@ type ProximityAlertTriggered struct {
10371067 Distance int `json:"distance"`
10381068}
10391069
1070+ // MessageAutoDeleteTimerChanged represents a service message about a change in
1071+ // auto-delete timer settings.
1072+ type MessageAutoDeleteTimerChanged struct {
1073+ // New auto-delete time for messages in the chat.
1074+ MessageAutoDeleteTime int `json:"message_auto_delete_time"`
1075+ }
1076+
1077+ // VoiceChatStarted represents a service message about a voice chat started in
1078+ // the chat.
1079+ type VoiceChatStarted struct {}
1080+
1081+ // VoiceChatEnded represents a service message about a voice chat ended in the
1082+ // chat.
1083+ type VoiceChatEnded struct {
1084+ // Voice chat duration; in seconds.
1085+ Duration int `json:"duration"`
1086+ }
1087+
1088+ // VoiceChatParticipantsInvited represents a service message about new members
1089+ // invited to a voice chat.
1090+ type VoiceChatParticipantsInvited struct {
1091+ // New members that were invited to the voice chat.
1092+ //
1093+ // optional
1094+ Users []User `json:"users"`
1095+ }
1096+
10401097// UserProfilePhotos contains a set of user profile photos.
10411098type UserProfilePhotos struct {
10421099 // TotalCount total number of profile pictures the target user has
@@ -1336,6 +1393,29 @@ type ChatPhoto struct {
13361393 BigFileUniqueID string `json:"big_file_unique_id"`
13371394}
13381395
1396+ // ChatInviteLink represents an invite link for a chat.
1397+ type ChatInviteLink struct {
1398+ // InviteLink is the invite link. If the link was created by another chat
1399+ // administrator, then the second part of the link will be replaced with “…”.
1400+ InviteLink string `json:"invite_link"`
1401+ // Creator of the link.
1402+ Creator User `json:"creator"`
1403+ // IsPrimary is true, if the link is primary.
1404+ IsPrimary bool `json:"is_primary"`
1405+ // IsRevoked is true, if the link is revoked.
1406+ IsRevoked bool `json:"is_revoked"`
1407+ // ExpireDate is the point in time (Unix timestamp) when the link will
1408+ // expire or has been expired.
1409+ //
1410+ // optional
1411+ ExpireDate int `json:"expire_date"`
1412+ // MemberLimit is the maximum number of users that can be members of the
1413+ // chat simultaneously after joining the chat via this invite link; 1-99999.
1414+ //
1415+ // optional
1416+ MemberLimit int `json:"member_limit"`
1417+ }
1418+
13391419// ChatMember contains information about one member of a chat.
13401420type ChatMember struct {
13411421 // User information about the user
@@ -1369,6 +1449,14 @@ type ChatMember struct {
13691449 //
13701450 // optional
13711451 CanBeEdited bool `json:"can_be_edited,omitempty"`
1452+ // CanManageChat administrators only.
1453+ // True, if the administrator can access the chat event log, chat
1454+ // statistics, message statistics in channels, see channel members, see
1455+ // anonymous administrators in supergoups and ignore slow mode. Implied by
1456+ // any other administrator privilege.
1457+ //
1458+ // optional
1459+ CanManageChat bool `json:"can_manage_chat"`
13721460 // CanPostMessages administrators only.
13731461 // True, if the administrator can post in the channel;
13741462 // channels only.
@@ -1386,6 +1474,11 @@ type ChatMember struct {
13861474 //
13871475 // optional
13881476 CanDeleteMessages bool `json:"can_delete_messages,omitempty"`
1477+ // CanManageVoiceChats administrators only.
1478+ // True, if the administrator can manage voice chats.
1479+ //
1480+ // optional
1481+ CanManageVoiceChats bool `json:"can_manage_voice_chats"`
13891482 // CanRestrictMembers administrators only.
13901483 // True, if the administrator can restrict, ban or unban chat members.
13911484 //
@@ -1455,6 +1548,25 @@ func (chat ChatMember) HasLeft() bool { return chat.Status == "left" }
14551548// WasKicked returns if the ChatMember was kicked from the chat.
14561549func (chat ChatMember ) WasKicked () bool { return chat .Status == "kicked" }
14571550
1551+ // ChatMemberUpdated represents changes in the status of a chat member.
1552+ type ChatMemberUpdated struct {
1553+ // Chat the user belongs to.
1554+ Chat Chat `json:"chat"`
1555+ // From is the performer of the action, which resulted in the change.
1556+ From User `json:"from"`
1557+ // Date the change was done in Unix time.
1558+ Date int `json:"date"`
1559+ // Previous information about the chat member.
1560+ OldChatMember ChatMember `json:"old_chat_member"`
1561+ // New information about the chat member.
1562+ NewChatMember ChatMember `json:"new_chat_member"`
1563+ // InviteLink is the link which was used by the user to join the chat;
1564+ // for joining by invite link events only.
1565+ //
1566+ // optional
1567+ InviteLink * ChatInviteLink `json:"invite_link"`
1568+ }
1569+
14581570// ChatPermissions describes actions that a non-administrator user is
14591571// allowed to take in a chat. All fields are optional.
14601572type ChatPermissions struct {
0 commit comments