File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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.
8181func (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.
102103func (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.
109111func (u * Update ) FromChat () * Chat {
110112 switch {
111113 case u .Message != nil :
You can’t perform that action at this time.
0 commit comments