mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add dev/production flags
This commit is contained in:
parent
a33b72f4ff
commit
a2d34a5317
20
cmd/main.go
20
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")
|
||||
if *runMode == "production" {
|
||||
// Production, joining all regular channels
|
||||
logrus.Info("[PRODUCTION]: Joining every channel.")
|
||||
db.InitialJoin(nb)
|
||||
// nb.Send("nourybot", "HeyGuys")
|
||||
|
||||
} 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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue