Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,11 @@ func (bot *BotAPI) GetUpdatesChan(config UpdateConfig) UpdatesChannel {

updates, err := bot.GetUpdates(config)
if err != nil {
log.Println(err)
// Transport-level errors (e.g. "unexpected EOF") come back as a
// *url.Error whose message embeds the full request URL — and the
// bot token is part of that URL, so logging err verbatim leaks
// it in cleartext. Redact before printing.
log.Println(strings.ReplaceAll(err.Error(), bot.Token, "[REDACTED]"))
log.Println("Failed to get updates, retrying in 3 seconds...")
time.Sleep(time.Second * 3)

Expand Down