Skip to content

Commit e6fdc8e

Browse files
Add user type documentation
1 parent b6df6c2 commit e6fdc8e

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

types.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,25 @@ func (ch UpdatesChannel) Clear() {
4949
}
5050
}
5151

52-
// User is a user on Telegram.
52+
// User represents a Telegram user or bot.
5353
type User struct {
54-
ID int `json:"id"`
55-
FirstName string `json:"first_name"`
56-
LastName string `json:"last_name"` // optional
57-
UserName string `json:"username"` // optional
58-
LanguageCode string `json:"language_code"` // optional
59-
IsBot bool `json:"is_bot"` // optional
54+
// ID is a unique identifier for this user or bot
55+
ID int `json:"id"`
56+
// FirstName user's or bot's first name
57+
FirstName string `json:"first_name"`
58+
// LastName user's or bot's last name
59+
// optional
60+
LastName string `json:"last_name"`
61+
// UserName user's or bot's username
62+
// optional
63+
UserName string `json:"username"`
64+
// LanguageCode IETF language tag of the user's language
65+
// more info: https://en.wikipedia.org/wiki/IETF_language_tag
66+
// optional
67+
LanguageCode string `json:"language_code"`
68+
// IsBot true, if this user is a bot
69+
// optional
70+
IsBot bool `json:"is_bot"`
6071
}
6172

6273
// String displays a simple text version of a user.

0 commit comments

Comments
 (0)