diff --git a/cmd/main.go b/cmd/main.go index 9e1304e..142e350 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" "time" @@ -9,12 +10,17 @@ import ( "github.com/lyx0/nourybot/pkg/config" "github.com/lyx0/nourybot/pkg/db" "github.com/lyx0/nourybot/pkg/handlers" + "github.com/sirupsen/logrus" ) var nb *bot.Bot func main() { + // No need to join every channel when on development mode. + runMode := flag.String("mode", "dev", "Mode in which to run. (dev/production") + flag.Parse() + conf := config.LoadConfig() nb = &bot.Bot{ @@ -41,8 +47,18 @@ func main() { handlers.PrivateMessage(message, nb) }) - // nb.TwitchClient.Join("nouryqt", "nourybot") - db.InitialJoin(nb) - // nb.Send("nourybot", "HeyGuys") + if *runMode == "production" { + // Production, joining all regular channels + logrus.Info("[PRODUCTION]: Joining every channel.") + db.InitialJoin(nb) + + } else if *runMode == "dev" { + // Development, only join my two channels + logrus.Info("[DEV]: Joining nouryqt and nourybot.") + + nb.TwitchClient.Join("nouryqt", "nourybot") + nb.Send("nourybot", "[DEV] Badabing Badaboom Pepepains") + } + nb.TwitchClient.Connect() }