WIP.
Long-polling errors seem to be due to tthe dev server crashes earlier.
This commit is contained in:
parent
58a01bff56
commit
216ec90646
2 changed files with 6 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
|
|
@ -141,7 +142,7 @@ func (a *App) scripture() {
|
||||||
fmt.Println("sending chat:", chat.ID)
|
fmt.Println("sending chat:", chat.ID)
|
||||||
fmt.Println("to bot:", a.bot)
|
fmt.Println("to bot:", a.bot)
|
||||||
a.bot.SendMarkdownMessage(chat.ID,
|
a.bot.SendMarkdownMessage(chat.ID,
|
||||||
fmt.Sprintf("**<u>Daily Scripture:</u><br>%s**\n\n%s (*%s*)", ref.String(), verse.String(), vv.Translation))
|
fmt.Sprintf("**<u>Daily Scripture:</u><br>%s**\n\n%s (*%s*)", ref.String(), verse.String(), strings.ToUpper(vv.Translation)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"slices"
|
"slices"
|
||||||
|
"time"
|
||||||
|
|
||||||
"code.destrealm.net/zancarius/justusbot/internal/settings"
|
"code.destrealm.net/zancarius/justusbot/internal/settings"
|
||||||
"github.com/mymmrac/telego"
|
"github.com/mymmrac/telego"
|
||||||
|
|
@ -227,7 +228,9 @@ func (b *bot) SetPolling(ctx context.Context, conf *settings.Settings) (err erro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updates, err := b.tgbot.UpdatesViaLongPolling(ctx, nil)
|
updates, err := b.tgbot.UpdatesViaLongPolling(ctx, &telego.GetUpdatesParams{
|
||||||
|
Timeout: 300,
|
||||||
|
}, telego.WithLongPollingUpdateInterval(time.Second*30))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue