From 0bc7588984e34a9f32c6b868497edf8944ebfebc Mon Sep 17 00:00:00 2001 From: usbharu Date: Sun, 20 Apr 2025 17:34:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Misskey=E3=81=AE=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=83=88=E3=82=B3=E3=83=AB=E3=81=A8=E3=83=91=E3=82=B9=E3=82=92?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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