refactor + fix добавление проекта
This commit is contained in:
@@ -17,12 +17,10 @@ func main() {
|
||||
initLogger()
|
||||
|
||||
botToken := mustEnv("TELEGRAM__TOKEN")
|
||||
loginURL := mustEnv("LOGIN_URL")
|
||||
baseURL := os.Getenv("BACKEND__BASE_URL")
|
||||
|
||||
backendClient := backend.New(backend.Config{
|
||||
BaseURL: baseURL,
|
||||
LoginURL: loginURL,
|
||||
BaseURL: mustEnv("BACKEND__BASE_URL"),
|
||||
LoginURL: mustEnv("LOGIN_URL"),
|
||||
})
|
||||
|
||||
var commandRouter = func(command string) bot.State {
|
||||
@@ -55,8 +53,6 @@ func main() {
|
||||
|
||||
dsp := echotron.NewDispatcher(botToken, newBot)
|
||||
|
||||
log.Info().Msg("bot starting...")
|
||||
|
||||
updateOpts := echotron.UpdateOptions{
|
||||
AllowedUpdates: []echotron.UpdateType{
|
||||
echotron.MessageUpdate,
|
||||
@@ -70,7 +66,8 @@ func main() {
|
||||
echotron.SetChatRequestLimit(0, 0)
|
||||
|
||||
for {
|
||||
if err := dsp.PollOptions(false, updateOpts); err != nil {
|
||||
err := dsp.PollOptions(false, updateOpts)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("dsp.Poll failed, retrying in 5 seconds...")
|
||||
time.Sleep(5 * time.Second)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user