소스 검색

Fix some defaults in the appservice config

Gary Kramlich 3 년 전
부모
커밋
79713cf0ef
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  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
 	}