diff --git a/main.go b/main.go index afb2ed9..69a78c3 100644 --- a/main.go +++ b/main.go @@ -65,7 +65,13 @@ func main() { events.On(events.Message, handleCommands) - client = rcon.NewSession("localhost", rconPort, rconPassword) + rconHost := "localhost" + + if envHost := os.Getenv("RCON_HOST"); envHost != "" { + rconHost = envHost + } + + client = rcon.NewSession(rconHost, rconPort, rconPassword) client.Debug = debug