all repos — telegram-bot-api @ 8e71d1db32b3d00bb003300b425ae3f82c25617b

Golang bindings for the Telegram Bot API

New Telegram Chat type, instead of previous UserOrGroupChat type
Syfaro syfaro@foxpaw.in
Fri, 09 Oct 2015 09:26:38 -0500
commit

8e71d1db32b3d00bb003300b425ae3f82c25617b

parent

7092cefe655def68e5a4b009f03270f7b9f2bbe5

1 files changed, 28 insertions(+), 27 deletions(-)

jump to
M types.gotypes.go

@@ -50,40 +50,41 @@ ID int `json:"id"`

Title string `json:"title"` } -// UserOrGroupChat is returned in Message, because it's not clear which it is. -type UserOrGroupChat struct { +// Chat is returned in Message, it contains information about the Chat a message was sent in. +type Chat struct { ID int `json:"id"` + Type string `json:"type"` + Title string `json:"title"` + UserName string `json:"username"` FirstName string `json:"first_name"` LastName string `json:"last_name"` - UserName string `json:"username"` - Title string `json:"title"` } // Message is returned by almost every request, and contains data about almost anything. type Message struct { - MessageID int `json:"message_id"` - From User `json:"from"` - Date int `json:"date"` - Chat UserOrGroupChat `json:"chat"` - ForwardFrom User `json:"forward_from"` - ForwardDate int `json:"forward_date"` - ReplyToMessage *Message `json:"reply_to_message"` - Text string `json:"text"` - Audio Audio `json:"audio"` - Document Document `json:"document"` - Photo []PhotoSize `json:"photo"` - Sticker Sticker `json:"sticker"` - Video Video `json:"video"` - Voice Voice `json:"voice"` - Caption string `json:"caption"` - Contact Contact `json:"contact"` - Location Location `json:"location"` - NewChatParticipant User `json:"new_chat_participant"` - LeftChatParticipant User `json:"left_chat_participant"` - NewChatTitle string `json:"new_chat_title"` - NewChatPhoto []PhotoSize `json:"new_chat_photo"` - DeleteChatPhoto bool `json:"delete_chat_photo"` - GroupChatCreated bool `json:"group_chat_created"` + MessageID int `json:"message_id"` + From User `json:"from"` + Date int `json:"date"` + Chat Chat `json:"chat"` + ForwardFrom User `json:"forward_from"` + ForwardDate int `json:"forward_date"` + ReplyToMessage *Message `json:"reply_to_message"` + Text string `json:"text"` + Audio Audio `json:"audio"` + Document Document `json:"document"` + Photo []PhotoSize `json:"photo"` + Sticker Sticker `json:"sticker"` + Video Video `json:"video"` + Voice Voice `json:"voice"` + Caption string `json:"caption"` + Contact Contact `json:"contact"` + Location Location `json:"location"` + NewChatParticipant User `json:"new_chat_participant"` + LeftChatParticipant User `json:"left_chat_participant"` + NewChatTitle string `json:"new_chat_title"` + NewChatPhoto []PhotoSize `json:"new_chat_photo"` + DeleteChatPhoto bool `json:"delete_chat_photo"` + GroupChatCreated bool `json:"group_chat_created"` } // Time converts the message timestamp into a Time.