all repos — telegram-bot-api @ 2024a55b8769e678719ba5dce8463cc7e1415e53

Golang bindings for the Telegram Bot API

slight code improvments, better language
Syfaro syfaro@foxpaw.in
Mon, 29 Jun 2015 22:44:12 -0500
commit

2024a55b8769e678719ba5dce8463cc7e1415e53

parent

7473250643e8f0913ba9306b6b7611e56beaf2e5

1 files changed, 10 insertions(+), 8 deletions(-)

jump to
M updates.goupdates.go

@@ -13,19 +13,21 @@ go func() {

for { updates, err := bot.GetUpdates(config) if err != nil { - if bot.Debug == true { + if bot.Debug { panic(err) } else { log.Println(err) - log.Println("Fail to GetUpdates,Retry in 3 Seconds...") + log.Println("Failed to get updates, retrying in 3 seconds...") time.Sleep(time.Second * 3) } - } else { - for _, update := range updates { - if update.UpdateID >= config.Offset { - config.Offset = update.UpdateID + 1 - bot.Updates <- update - } + + continue + } + + for _, update := range updates { + if update.UpdateID >= config.Offset { + config.Offset = update.UpdateID + 1 + bot.Updates <- update } } }