Parcourir la source

Fix some defaults in the appservice config

Gary Kramlich il y a 3 ans
Parent
commit
79713cf0ef
1 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 12 0
      config/appservice.go

+ 12 - 0
config/appservice.go

@@ -18,6 +18,18 @@ func (a *appservice) validate() error {
 		a.ID = "discord"
 	}
 
+	if a.Address == "" {
+		a.Address = "http://localhost:29350"
+	}
+
+	if a.Hostname == "" {
+		a.Hostname = "0.0.0.0"
+	}
+
+	if a.Port == 0 {
+		a.Port = 29350
+	}
+
 	if err := a.Bot.validate(); err != nil {
 		return err
 	}