From bfea93312a8814a8065c45629d935a7d64da2690 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Thu, 2 Sep 2021 19:17:01 +0800 Subject: [PATCH] fix: panic on setting servers. Fixes #1039 --- main.go | 2 +- server/scf.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 189a251..271a28a 100644 --- a/main.go +++ b/main.go @@ -632,7 +632,7 @@ func newClient() *client.QQClient { log.Infof("检测到 address.txt 文件. 将覆盖目标IP.") addr := global.ReadAddrFile("address.txt") if len(addr) > 0 { - cli.SetCustomServer(addr) + c.SetCustomServer(addr) } log.Infof("读取到 %v 个自定义地址.", len(addr)) } diff --git a/server/scf.go b/server/scf.go index 0ea4ca6..1caf983 100644 --- a/server/scf.go +++ b/server/scf.go @@ -87,8 +87,7 @@ func RunLambdaClient(bot *coolq.CQBot, conf *config.LambdaServer) { case "scf": // tencent serverless function base := fmt.Sprintf("http://%s:%s/runtime/", os.Getenv("SCF_RUNTIME_API"), - os.Getenv("SCF_RUNTIME_API_PORT"), - ) + os.Getenv("SCF_RUNTIME_API_PORT")) cli.nextURL = base + "invocation/next" cli.responseURL = base + "invocation/response" post, err := http.Post(base+"init/ready", "", nil)