mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
change the command prefix based on the environment.
if running in the `prod` environment continue using the `()` prefix. otherwise in `dev` environment use !! as the prefix so we don't interfere with database calls to the production database because it was the same commands in both environments.
This commit is contained in:
parent
98962a98b7
commit
c4a05a2619
|
@ -74,7 +74,6 @@ func main() {
|
|||
cfg.twitchClientId = os.Getenv("TWITCH_CLIENT_ID")
|
||||
cfg.twitchClientSecret = os.Getenv("TWITCH_CLIENT_SECRET")
|
||||
cfg.wolframAlphaAppID = os.Getenv("WOLFRAMALPHA_APP_ID")
|
||||
cfg.commandPrefix = os.Getenv("TWITCH_COMMAND_PREFIX")
|
||||
cfg.twitchID = os.Getenv("TWITCH_ID")
|
||||
cfg.env = os.Getenv("ENV")
|
||||
tc := twitch.NewClient(cfg.twitchUsername, cfg.twitchOauth)
|
||||
|
@ -82,8 +81,10 @@ func main() {
|
|||
switch cfg.env {
|
||||
case "dev":
|
||||
cfg.db.dsn = os.Getenv("DEV_DSN")
|
||||
cfg.commandPrefix = "!!"
|
||||
case "prod":
|
||||
cfg.db.dsn = os.Getenv("PROD_DSN")
|
||||
cfg.commandPrefix = "()"
|
||||
}
|
||||
// Database config variables
|
||||
cfg.db.maxOpenConns = 25
|
||||
|
|
Loading…
Reference in a new issue