From b60db1d2e17d88a92816d9ad3a49fd50da08ef87 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Mon, 8 Oct 2018 13:58:50 -0500 Subject: [PATCH] Revert "Remove a broken check for GetUpdatesChan." This was not properly tested and results in the bot looping. This reverts commit 5f38203a155afa901c7deb70596a088a8424a9ee. --- bot.go | 5 ++++- passport.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bot.go b/bot.go index b88d8db..d56aaf8 100644 --- a/bot.go +++ b/bot.go @@ -501,7 +501,10 @@ func (bot *BotAPI) GetUpdatesChan(config UpdateConfig) (UpdatesChannel, error) { } for _, update := range updates { - ch <- update + if update.UpdateID >= config.Offset { + config.Offset = update.UpdateID + 1 + ch <- update + } } } }() diff --git a/passport.go b/passport.go index 5f55006..f949b88 100644 --- a/passport.go +++ b/passport.go @@ -307,7 +307,7 @@ type ( MiddleNameNative string `json:"middle_name_native"` } - // IDDocumentData https://core.telegram.org/passport#iddocumentdata + // IdDocumentData https://core.telegram.org/passport#iddocumentdata IDDocumentData struct { DocumentNumber string `json:"document_no"` ExpiryDate string `json:"expiry_date"`