diff --git a/internal/config/config.go b/internal/config/config.go index a932d98..c77833a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -5,8 +5,6 @@ import ( "strconv" ) -// const Version string = "v0.0.1" - type Config struct { Debug bool TelegramBotToken string diff --git a/internal/frigate/frigate.go b/internal/frigate/frigate.go index 289c51f..71dc077 100644 --- a/internal/frigate/frigate.go +++ b/internal/frigate/frigate.go @@ -7,7 +7,6 @@ import ( "io" "net/http" "os" - "reflect" "strconv" "strings" "time" @@ -73,8 +72,6 @@ type EventStruct struct { var Events EventsStruct var Event EventStruct -var floatType = reflect.TypeOf(float64(0)) -var stringType = reflect.TypeOf("") func GETZones(Zones []any) []string { var my_zones []string diff --git a/main.go b/main.go index ca2bd75..77d0102 100644 --- a/main.go +++ b/main.go @@ -10,9 +10,13 @@ import ( "github.com/oldtyt/frigate-telegram/internal/log" ) +// FrigateEvents is frigate events struct var FrigateEvents frigate.EventsStruct + +// FrigateEvent is frigate event struct var FrigateEvent frigate.EventStruct +// PongBot is needed to check the work of the bot. func PongBot(bot *tgbotapi.BotAPI) { u := tgbotapi.NewUpdate(0) u.Timeout = 60 @@ -59,10 +63,9 @@ func main() { conf := config.New() // Prepare startup msg - startup_msg := "Starting frigate-telegram.\n" - // startup_msg += "Version: " + config.Version + "\n" - startup_msg += "Frigate URL: " + conf.FrigateURL + "\n" - log.Info.Println(startup_msg) + startupMsg := "Starting frigate-telegram.\n" + startupMsg += "Frigate URL: " + conf.FrigateURL + "\n" + log.Info.Println(startupMsg) // Initializing telegram bot bot, err := tgbotapi.NewBotAPI(conf.TelegramBotToken) @@ -73,7 +76,7 @@ func main() { log.Info.Println("Authorized on account " + bot.Self.UserName) // Send startup msg. - _, errmsg := bot.Send(tgbotapi.NewMessage(conf.TelegramChatID, startup_msg)) + _, errmsg := bot.Send(tgbotapi.NewMessage(conf.TelegramChatID, startupMsg)) if errmsg != nil { log.Error.Println(errmsg.Error()) }