25 lines
582 B
Go
25 lines
582 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"git.inkling.su/mrqiz/schedule-poll/internal/config"
|
|
"git.inkling.su/mrqiz/schedule-poll/internal/schedule"
|
|
"git.inkling.su/mrqiz/schedule-poll/internal/telegram"
|
|
"github.com/robfig/cron/v3"
|
|
)
|
|
|
|
func main() {
|
|
err := telegram.GetMe()
|
|
|
|
if err != nil {
|
|
log.Fatalln("Unable to connect to telegram", err)
|
|
}
|
|
|
|
log.Printf("Tracking schedule for week %s, group %s\n", config.AppConfig.Schedule.StartDate, config.AppConfig.Schedule.GroupId)
|
|
|
|
c := cron.New(cron.WithSeconds())
|
|
c.AddFunc(config.AppConfig.CronPattern, schedule.PollSchedule)
|
|
c.Run()
|
|
}
|