diff --git a/main.go b/main.go index e74a326..6b2a9bf 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,8 @@ import ( var client *misskey.Client var endpoint = os.Getenv("MISSKEY_ENDPOINT") +var protocol, hasProtocolEnv = os.LookupEnv("MISSKEY_PROTOCOL") +var path = os.Getenv("MISSKEY_PATH") var apiKey = os.Getenv("MISSKEY_API_TOKEN") var ( @@ -155,9 +157,14 @@ var ( ) func main() { + + if !hasProtocolEnv { + protocol = "https" + } + options, err := misskey.NewClientWithOptions( misskey.WithAPIToken(apiKey), - misskey.WithBaseURL("https", endpoint, ""), + misskey.WithBaseURL(protocol, endpoint, path), misskey.WithLogLevel(logrus.InfoLevel), ) client = options