Skip to content

Commit

Permalink
Handle error on sending texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Brawl345 committed Oct 10, 2024
1 parent bff2ff1 commit 166b389
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handler/feed_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ func (h *Handler) sendText(chatId int64, text string, url string) error {
log.Printf("%s: Flood error, retrying after: %d seconds", url,
floodError.RetryAfter)
time.Sleep(time.Duration(err.(telebot.FloodError).RetryAfter) * time.Second)
h.sendText(chatId, text, url)
err := h.sendText(chatId, text, url)
if err != nil {
return err
}
} else {
return err
}
Expand Down

0 comments on commit 166b389

Please sign in to comment.