diff --git a/loyalty/manager.go b/loyalty/manager.go index 5ff0b8c..f1e2aa3 100644 --- a/loyalty/manager.go +++ b/loyalty/manager.go @@ -73,7 +73,7 @@ func NewManager(db *database.LocalDBClient, twitchManager *twitch.Manager, logge // Retrieve configs var rewards []Reward - if err := db.GetJSON(RewardsKey, &rewards); err != nil { + if err := db.GetJSON(RewardsKey, &rewards); err == nil { loyalty.Rewards.Set(rewards) } else { if !errors.Is(err, database.ErrEmptyKey) { @@ -82,7 +82,7 @@ func NewManager(db *database.LocalDBClient, twitchManager *twitch.Manager, logge } var goals []Goal - if err := db.GetJSON(GoalsKey, &goals); err != nil { + if err := db.GetJSON(GoalsKey, &goals); err == nil { loyalty.Goals.Set(goals) } else { if !errors.Is(err, database.ErrEmptyKey) { @@ -91,7 +91,7 @@ func NewManager(db *database.LocalDBClient, twitchManager *twitch.Manager, logge } var queue []Redeem - if err := db.GetJSON(QueueKey, &queue); err != nil { + if err := db.GetJSON(QueueKey, &queue); err == nil { loyalty.Queue.Set(queue) } else { if !errors.Is(err, database.ErrEmptyKey) { diff --git a/loyalty/twitch-bot.go b/loyalty/twitch-bot.go index 7ef9ac2..2467ea4 100644 --- a/loyalty/twitch-bot.go +++ b/loyalty/twitch-bot.go @@ -16,6 +16,7 @@ import ( func (m *Manager) SetupTwitch() { bot := m.twitchManager.Client().Bot if bot == nil { + m.logger.Warn("bot is offline or not configured, could not setup commands") return } @@ -120,6 +121,8 @@ func (m *Manager) SetupTwitch() { } } }() + + m.logger.Info("loyalty twitch setup completed") } func (m *Manager) StopTwitch() {