Skip to content

Commit 8806fb3

Browse files
authored
Update types.go
1 parent 01e6fd2 commit 8806fb3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ type Update struct {
7676
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query"`
7777
}
7878

79-
// SentFrom return user sender of update. Can be nil, if telegram wont provide info about him in
80-
// update object.
79+
// SentFrom returns the user who sent an update. Can be nil, if Telegram did not provide information
80+
// about the user in the update object.
8181
func (u *Update) SentFrom() *User {
8282
switch {
8383
case u.Message != nil:
@@ -99,13 +99,15 @@ func (u *Update) SentFrom() *User {
9999
}
100100
}
101101

102+
// CallbackData returns the callback query data, if it exists.
102103
func (u *Update) CallbackData() string {
103104
if u.CallbackQuery != nil {
104105
return u.CallbackQuery.Data
105106
}
106107
return ""
107108
}
108109

110+
// FromChat returns the chat where an update occured.
109111
func (u *Update) FromChat() *Chat {
110112
switch {
111113
case u.Message != nil:

0 commit comments

Comments
 (0)