Add user type documentation

bot-api-6.1
Ilya Kaznacheev 2020-10-24 13:34:34 +03:00
parent b6df6c273a
commit e6fdc8e02a
No known key found for this signature in database
GPG Key ID: 7E2C1D8A4AB37D50
1 changed files with 18 additions and 7 deletions

View File

@ -49,14 +49,25 @@ func (ch UpdatesChannel) Clear() {
} }
} }
// User is a user on Telegram. // User represents a Telegram user or bot.
type User struct { type User struct {
// ID is a unique identifier for this user or bot
ID int `json:"id"` ID int `json:"id"`
// FirstName user's or bot's first name
FirstName string `json:"first_name"` FirstName string `json:"first_name"`
LastName string `json:"last_name"` // optional // LastName user's or bot's last name
UserName string `json:"username"` // optional // optional
LanguageCode string `json:"language_code"` // optional LastName string `json:"last_name"`
IsBot bool `json:"is_bot"` // optional // UserName user's or bot's username
// optional
UserName string `json:"username"`
// LanguageCode IETF language tag of the user's language
// more info: https://en.wikipedia.org/wiki/IETF_language_tag
// optional
LanguageCode string `json:"language_code"`
// IsBot true, if this user is a bot
// optional
IsBot bool `json:"is_bot"`
} }
// String displays a simple text version of a user. // String displays a simple text version of a user.