@@ -16,7 +16,7 @@ import (
1616 "time"
1717
1818 log "github.com/go-pkgz/lgr"
19- "github.com/go-pkgz/repeater"
19+ "github.com/go-pkgz/repeater/v2 "
2020 "github.com/microcosm-cc/bluemonday"
2121 "golang.org/x/net/html"
2222)
@@ -34,8 +34,8 @@ type TelegramParams struct {
3434type Telegram struct {
3535 TelegramParams
3636
37- // Identifier of the first update to be requested.
38- // Should be equal to LastSeenUpdateID + 1
37+ // identifier of the first update to be requested.
38+ // should be equal to LastSeenUpdateID + 1
3939 // See https://core.telegram.org/bots/api#getupdates
4040 updateOffset int
4141 apiPollInterval time.Duration // interval to check updates from Telegram API and answer to users
@@ -247,7 +247,7 @@ func (t *Telegram) CheckToken(token, user string) (telegram, site string, err er
247247 return "" , "" , errors .New ("user does not match original requester" )
248248 }
249249
250- // Delete request
250+ // delete request
251251 t .requests .Lock ()
252252 delete (t .requests .data , token )
253253 t .requests .Unlock ()
@@ -387,7 +387,7 @@ func (t *Telegram) processUpdates(ctx context.Context, updates *TelegramUpdate)
387387
388388 t .requests .RLock ()
389389 authRequest , ok := t .requests .data [token ]
390- if ! ok { // No such token
390+ if ! ok { // no such token
391391 t .requests .RUnlock ()
392392 if t .ErrorMsg != "" {
393393 if err := t .sendText (ctx , update .Message .Chat .ID , t .ErrorMsg ); err != nil {
@@ -436,7 +436,7 @@ func (t *Telegram) botInfo(ctx context.Context) (*TelegramBotInfo, error) {
436436
437437// Request makes a request to the Telegram API and return the result
438438func (t * Telegram ) Request (ctx context.Context , method string , b []byte , data any ) error {
439- return repeater .NewDefault (3 , time .Millisecond * 250 ).Do (ctx , func () error {
439+ return repeater .NewFixed (3 , time .Millisecond * 250 ).Do (ctx , func () error {
440440 url := fmt .Sprintf ("%s%s/%s" , t .apiPrefix , t .Token , method )
441441
442442 var req * http.Request
0 commit comments