Revert "Remove a broken check for GetUpdatesChan."

This was not properly tested and results in the bot looping.

This reverts commit 5f38203a15.
bot-api-6.1
Syfaro 2018-10-08 13:58:50 -05:00
parent e2f846d83a
commit b60db1d2e1
2 changed files with 5 additions and 2 deletions

5
bot.go
View File

@ -501,7 +501,10 @@ func (bot *BotAPI) GetUpdatesChan(config UpdateConfig) (UpdatesChannel, error) {
} }
for _, update := range updates { for _, update := range updates {
ch <- update if update.UpdateID >= config.Offset {
config.Offset = update.UpdateID + 1
ch <- update
}
} }
} }
}() }()

View File

@ -307,7 +307,7 @@ type (
MiddleNameNative string `json:"middle_name_native"` MiddleNameNative string `json:"middle_name_native"`
} }
// IDDocumentData https://core.telegram.org/passport#iddocumentdata // IdDocumentData https://core.telegram.org/passport#iddocumentdata
IDDocumentData struct { IDDocumentData struct {
DocumentNumber string `json:"document_no"` DocumentNumber string `json:"document_no"`
ExpiryDate string `json:"expiry_date"` ExpiryDate string `json:"expiry_date"`