1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

fix: panic on setting servers.

Fixes #1039
This commit is contained in:
wdvxdr 2021-09-02 19:17:01 +08:00
parent f8dfa8db2c
commit bfea93312a
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
2 changed files with 2 additions and 3 deletions

View File

@ -632,7 +632,7 @@ func newClient() *client.QQClient {
log.Infof("检测到 address.txt 文件. 将覆盖目标IP.") log.Infof("检测到 address.txt 文件. 将覆盖目标IP.")
addr := global.ReadAddrFile("address.txt") addr := global.ReadAddrFile("address.txt")
if len(addr) > 0 { if len(addr) > 0 {
cli.SetCustomServer(addr) c.SetCustomServer(addr)
} }
log.Infof("读取到 %v 个自定义地址.", len(addr)) log.Infof("读取到 %v 个自定义地址.", len(addr))
} }

View File

@ -87,8 +87,7 @@ func RunLambdaClient(bot *coolq.CQBot, conf *config.LambdaServer) {
case "scf": // tencent serverless function case "scf": // tencent serverless function
base := fmt.Sprintf("http://%s:%s/runtime/", base := fmt.Sprintf("http://%s:%s/runtime/",
os.Getenv("SCF_RUNTIME_API"), os.Getenv("SCF_RUNTIME_API"),
os.Getenv("SCF_RUNTIME_API_PORT"), os.Getenv("SCF_RUNTIME_API_PORT"))
)
cli.nextURL = base + "invocation/next" cli.nextURL = base + "invocation/next"
cli.responseURL = base + "invocation/response" cli.responseURL = base + "invocation/response"
post, err := http.Post(base+"init/ready", "", nil) post, err := http.Post(base+"init/ready", "", nil)