Skip to content

Commit

Permalink
fix: update main
Browse files Browse the repository at this point in the history
  • Loading branch information
Madh93 committed Dec 28, 2024
1 parent 7544b6f commit 3fb3be6
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,33 @@ package main

import (
"fmt"

"github.com/Madh93/hoarderbot/internal/config"
"github.com/Madh93/hoarderbot/internal/hoarderbot"
"github.com/Madh93/hoarderbot/internal/logging"
)

// main initializes the configuration, sets up logging, and starts the
// Hoarderbot.
func main() {
fmt.Println("Hello World!")
// Load configuration
config := config.New()

// Setup logger
logger := logging.New(&config.Logging)
if config.Path != "" {
logger.Debug(fmt.Sprintf("Loaded configuration from %s", config.Path))
}

// Setup hoarderbot
hoarderbot := hoarderbot.New(logger, &hoarderbot.Config{
Hoarder: &config.Hoarder,
Telegram: &config.Telegram,
})

// Let's go
logger.Info("3, 2, 1... Launching Hoarderbot... 🚀")
if err := hoarderbot.Run(); err != nil {
logger.Fatal("💥 Something went wrong.", "error", err)
}
}

0 comments on commit 3fb3be6

Please sign in to comment.