Add user type documentation
parent
b6df6c273a
commit
e6fdc8e02a
25
types.go
25
types.go
|
@ -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 int `json:"id"`
|
// ID is a unique identifier for this user or bot
|
||||||
FirstName string `json:"first_name"`
|
ID int `json:"id"`
|
||||||
LastName string `json:"last_name"` // optional
|
// FirstName user's or bot's first name
|
||||||
UserName string `json:"username"` // optional
|
FirstName string `json:"first_name"`
|
||||||
LanguageCode string `json:"language_code"` // optional
|
// LastName user's or bot's last name
|
||||||
IsBot bool `json:"is_bot"` // optional
|
// optional
|
||||||
|
LastName string `json:"last_name"`
|
||||||
|
// 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.
|
||||||
|
|
Loading…
Reference in New Issue