New Telegram Chat type, instead of previous UserOrGroupChat type

bot-api-6.1
Syfaro 2015-10-09 09:26:38 -05:00
parent 7092cefe65
commit 8e71d1db32
1 changed files with 28 additions and 27 deletions

View File

@ -50,13 +50,14 @@ type GroupChat struct {
Title string `json:"title"` Title string `json:"title"`
} }
// UserOrGroupChat is returned in Message, because it's not clear which it is. // Chat is returned in Message, it contains information about the Chat a message was sent in.
type UserOrGroupChat struct { type Chat struct {
ID int `json:"id"` ID int `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
UserName string `json:"username"`
FirstName string `json:"first_name"` FirstName string `json:"first_name"`
LastName string `json:"last_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. // Message is returned by almost every request, and contains data about almost anything.
@ -64,7 +65,7 @@ type Message struct {
MessageID int `json:"message_id"` MessageID int `json:"message_id"`
From User `json:"from"` From User `json:"from"`
Date int `json:"date"` Date int `json:"date"`
Chat UserOrGroupChat `json:"chat"` Chat Chat `json:"chat"`
ForwardFrom User `json:"forward_from"` ForwardFrom User `json:"forward_from"`
ForwardDate int `json:"forward_date"` ForwardDate int `json:"forward_date"`
ReplyToMessage *Message `json:"reply_to_message"` ReplyToMessage *Message `json:"reply_to_message"`