diff --git a/Makefile b/Makefile index cf14f1f..9d2ae9c 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,12 @@ build: run: ./bin/${BINARY_NAME} -env="prod" +up: + docker compose up + +down: + docker compose down + prod: cd cmd/nourybot && go build -o ${BINARY_NAME} mv cmd/nourybot/${BINARY_NAME} ./bin/${BINARY_NAME} diff --git a/cmd/nourybot/commands.go b/cmd/nourybot/commands.go index 47c7a23..b403b29 100644 --- a/cmd/nourybot/commands.go +++ b/cmd/nourybot/commands.go @@ -200,6 +200,10 @@ func (app *application) handleCommand(message twitch.PrivateMessage) { if userLevel >= 100 { app.DebugCommand(cmdParams[2], message) } + case "env": + if userLevel >= 100 { + reply = app.Environment + } } // -------------------------------- diff --git a/cmd/nourybot/main.go b/cmd/nourybot/main.go index 8a7d358..72d8474 100644 --- a/cmd/nourybot/main.go +++ b/cmd/nourybot/main.go @@ -41,6 +41,7 @@ type application struct { Db *sql.DB Models data.Models Scheduler *cron.Cron + Environment string // Rdb *redis.Client } @@ -122,6 +123,7 @@ func main() { Db: db, Models: data.NewModels(db), Scheduler: cron.New(), + Environment: cfg.env, } app.Log.Infow("db.Stats",