Skip to content

Commit

Permalink
Set topic to value of BYTEBOT_TOPIC env var at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
bbriggs committed Jan 23, 2024
1 parent 017b524 commit b03d46f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/rs/zerolog/log"
)

const (
var (
topic = "discord-inbound"
)

Expand All @@ -25,6 +25,12 @@ func main() {

initOpenAIClient()

if os.Getenv("BYTEBOT_TOPIC") != "" {
topic = os.Getenv("BYTEBOT_TOPIC")
} else {
log.Warn().Msg("BYTEBOT_TOPIC not set, using default topic: discord-inbound")
}

// Create a new pubsub client
log.Info().
Str("topic", topic).
Expand Down

0 comments on commit b03d46f

Please sign in to comment.