package userbot import ( "context" "github.com/rs/zerolog/log" "math/rand" "time" ) func MotivationTask(b *Userbot) func() { return func() { rand.Seed(time.Now().UnixNano()) time.Sleep(time.Duration(rand.Float64()*20) * time.Minute) if b.Account.Motivation { builder := b.Sender.Resolve("@StartupWarsBot") if builder != nil { _, err := builder.Text(context.Background(), b.Account.MotivationCommand) if err != nil { log.Error().Err(err) return } } } } }