Merge pull request #371 from metalmatze/test-offline

Expose offline settings for Bot
pull/425/head
demget 3 years ago committed by Demian
parent f29096837c
commit 1b57dbc404

@ -48,7 +48,7 @@ func NewBot(pref Settings) (*Bot, error) {
client: client,
}
if pref.offline {
if pref.Offline {
bot.Me = &User{}
} else {
user, err := bot.getMe()
@ -113,8 +113,8 @@ type Settings struct {
// HTTP Client used to make requests to telegram api
Client *http.Client
// offline allows to create a bot without network for testing purposes.
offline bool
// Offline allows to create a bot without network for testing purposes.
Offline bool
}
// Update object represents an incoming update.

@ -35,7 +35,7 @@ func TestMiddlewarePoller(t *testing.T) {
var ids []int
pref := defaultSettings()
pref.offline = true
pref.Offline = true
b, err := NewBot(pref)
if err != nil {

Loading…
Cancel
Save