all repos — telegram-bot-api @ b4d9865c2b275606dbf4d84113b327dcc4a3aa62

Golang bindings for the Telegram Bot API

Add chat type documentation
Ilya Kaznacheev ilya@kaznacheev.me
Sat, 24 Oct 2020 13:36:41 +0300
commit

b4d9865c2b275606dbf4d84113b327dcc4a3aa62

parent

e6fdc8e02a7cb652a10914ae21dd73483c193ca1

1 files changed, 32 insertions(+), 11 deletions(-)

jump to
M types.gotypes.go

@@ -104,17 +104,38 @@ }

// Chat contains information about the place a message was sent. type Chat struct { - ID int64 `json:"id"` - Type string `json:"type"` - Title string `json:"title"` // optional - UserName string `json:"username"` // optional - FirstName string `json:"first_name"` // optional - LastName string `json:"last_name"` // optional - AllMembersAreAdmins bool `json:"all_members_are_administrators"` // optional - Photo *ChatPhoto `json:"photo"` - Description string `json:"description,omitempty"` // optional - InviteLink string `json:"invite_link,omitempty"` // optional - PinnedMessage *Message `json:"pinned_message"` // optional + // ID is a unique identifier for this chat + ID int64 `json:"id"` + // Type of chat, can be either “private”, “group”, “supergroup” or “channel” + Type string `json:"type"` + // Title for supergroups, channels and group chats + // optional + Title string `json:"title"` + // UserName for private chats, supergroups and channels if available + // optional + UserName string `json:"username"` + // FirstName of the other party in a private chat + // optional + FirstName string `json:"first_name"` + // LastName of the other party in a private chat + // optional + LastName string `json:"last_name"` + // AllMembersAreAdmins + // optional + AllMembersAreAdmins bool `json:"all_members_are_administrators"` + // Photo is a chat photo + Photo *ChatPhoto `json:"photo"` + // Description for groups, supergroups and channel chats + // optional + Description string `json:"description,omitempty"` + // InviteLink is a chat invite link, for groups, supergroups and channel chats. + // Each administrator in a chat generates their own invite links, + // so the bot must first generate the link using exportChatInviteLink + // optional + InviteLink string `json:"invite_link,omitempty"` + // PinnedMessage Pinned message, for groups, supergroups and channels + // optional + PinnedMessage *Message `json:"pinned_message"` } // IsPrivate returns if the Chat is a private conversation.