Skip to content

Commit

Permalink
Minor API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Byrd committed Dec 11, 2017
1 parent b831116 commit a2d28e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ type InlineButton struct {
URL string `json:"url,omitempty"`
Data string `json:"callback_data,omitempty"`
InlineQuery string `json:"switch_inline_query,omitempty"`

Action func(*Callback)
}

// CallbackUnique returns InlineButto.Unique.
Expand Down
2 changes: 2 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ type ReplyButton struct {

Contact bool `json:"request_contact,omitempty"`
Location bool `json:"request_location,omitempty"`

Action func(*Callback)
}

// InlineKeyboardMarkup represents an inline keyboard that appears
Expand Down
6 changes: 5 additions & 1 deletion poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"github.com/pkg/errors"
)

var (
ErrCouldNotUpdate = errors.New("getUpdates() failed")
)

// Poller is a provider of Updates.
//
// All pollers must implement Poll(), which accepts bot
Expand Down Expand Up @@ -90,7 +94,7 @@ func (p *LongPoller) Poll(b *Bot, dest chan Update, stop chan struct{}) {
updates, err := b.getUpdates(p.LastUpdateID+1, p.Timeout)

if err != nil {
b.debug(errors.Wrap(err, "getUpdates() failed"))
b.debug(ErrCouldNotUpdate)
continue
}

Expand Down

0 comments on commit a2d28e6

Please sign in to comment.