Skip to content

Commit d2ea97f

Browse files
Add chat member type documentation
1 parent f54e994 commit d2ea97f

File tree

1 file changed

+89
-17
lines changed

1 file changed

+89
-17
lines changed

types.go

Lines changed: 89 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -911,23 +911,95 @@ type ForceReply struct {
911911

912912
// ChatMember is information about a member in a chat.
913913
type ChatMember struct {
914-
User *User `json:"user"`
915-
Status string `json:"status"`
916-
CustomTitle string `json:"custom_title,omitempty"` // optional
917-
UntilDate int64 `json:"until_date,omitempty"` // optional
918-
CanBeEdited bool `json:"can_be_edited,omitempty"` // optional
919-
CanChangeInfo bool `json:"can_change_info,omitempty"` // optional
920-
CanPostMessages bool `json:"can_post_messages,omitempty"` // optional
921-
CanEditMessages bool `json:"can_edit_messages,omitempty"` // optional
922-
CanDeleteMessages bool `json:"can_delete_messages,omitempty"` // optional
923-
CanInviteUsers bool `json:"can_invite_users,omitempty"` // optional
924-
CanRestrictMembers bool `json:"can_restrict_members,omitempty"` // optional
925-
CanPinMessages bool `json:"can_pin_messages,omitempty"` // optional
926-
CanPromoteMembers bool `json:"can_promote_members,omitempty"` // optional
927-
CanSendMessages bool `json:"can_send_messages,omitempty"` // optional
928-
CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` // optional
929-
CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // optional
930-
CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` // optional
914+
// User information about the user
915+
User *User `json:"user"`
916+
// Status the member's status in the chat.
917+
// Can be
918+
// “creator”,
919+
// “administrator”,
920+
// “member”,
921+
// “restricted”,
922+
// “left” or
923+
// “kicked”
924+
Status string `json:"status"`
925+
// CustomTitle owner and administrators only. Custom title for this user
926+
//
927+
// optional
928+
CustomTitle string `json:"custom_title,omitempty"`
929+
// UntilDate restricted and kicked only.
930+
// Date when restrictions will be lifted for this user;
931+
// unix time.
932+
//
933+
// optional
934+
UntilDate int64 `json:"until_date,omitempty"`
935+
// CanBeEdited administrators only.
936+
// True, if the bot is allowed to edit administrator privileges of that user.
937+
//
938+
// optional
939+
CanBeEdited bool `json:"can_be_edited,omitempty"`
940+
// CanChangeInfo administrators and restricted only.
941+
// True, if the user is allowed to change the chat title, photo and other settings.
942+
//
943+
// optional
944+
CanChangeInfo bool `json:"can_change_info,omitempty"`
945+
// CanChangeInfo administrators only.
946+
// True, if the administrator can post in the channel;
947+
// channels only.
948+
//
949+
// optional
950+
CanPostMessages bool `json:"can_post_messages,omitempty"`
951+
// CanEditMessages administrators only.
952+
// True, if the administrator can edit messages of other users and can pin messages;
953+
// channels only.
954+
//
955+
// optional
956+
CanEditMessages bool `json:"can_edit_messages,omitempty"`
957+
// CanDeleteMessages administrators only.
958+
// True, if the administrator can delete messages of other users.
959+
//
960+
// optional
961+
CanDeleteMessages bool `json:"can_delete_messages,omitempty"`
962+
// CanInviteUsers administrators and restricted only.
963+
// True, if the user is allowed to invite new users to the chat.
964+
//
965+
// optional
966+
CanInviteUsers bool `json:"can_invite_users,omitempty"`
967+
// CanRestrictMembers administrators only.
968+
// True, if the administrator can restrict, ban or unban chat members.
969+
//
970+
// optional
971+
CanRestrictMembers bool `json:"can_restrict_members,omitempty"`
972+
// CanPinMessages
973+
//
974+
// optional
975+
CanPinMessages bool `json:"can_pin_messages,omitempty"`
976+
// CanPromoteMembers administrators only.
977+
// True, if the administrator can add new administrators
978+
// with a subset of their own privileges or demote administrators that he has promoted,
979+
// directly or indirectly (promoted by administrators that were appointed by the user).
980+
//
981+
// optional
982+
CanPromoteMembers bool `json:"can_promote_members,omitempty"`
983+
// CanSendMessages
984+
//
985+
// optional
986+
CanSendMessages bool `json:"can_send_messages,omitempty"`
987+
// CanSendMediaMessages restricted only.
988+
// True, if the user is allowed to send text messages, contacts, locations and venues
989+
//
990+
// optional
991+
CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"`
992+
// CanSendOtherMessages restricted only.
993+
// True, if the user is allowed to send audios, documents,
994+
// photos, videos, video notes and voice notes.
995+
//
996+
// optional
997+
CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"`
998+
// CanAddWebPagePreviews restricted only.
999+
// True, if the user is allowed to add web page previews to their messages.
1000+
//
1001+
// optional
1002+
CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"`
9311003
}
9321004

9331005
// IsCreator returns if the ChatMember was the creator of the chat.

0 commit comments

Comments
 (0)