From 46dde0cd18714996b106ebf2c16c6c23f6853885 Mon Sep 17 00:00:00 2001 From: liyp Date: Tue, 23 Apr 2024 21:32:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9lsp=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- workers/lsp.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 74eeb37..2666aab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ data.db test.json -config.toml \ No newline at end of file +config.toml +*.exe \ No newline at end of file diff --git a/workers/lsp.go b/workers/lsp.go index c3c1e0c..0255b5b 100644 --- a/workers/lsp.go +++ b/workers/lsp.go @@ -15,7 +15,7 @@ type Lsp struct { func (a *Lsp) GetMsg() string { a.AllowGroup = []string{"313047773"} - url := "https://api.lolicon.app/setu/v2?size=mini&r18=0" + url := "https://api.lolicon.app/setu/v2?r18=0&size=small" resp, err := http.Get(url) if err != nil { return "获取失败" @@ -34,11 +34,11 @@ func (a *Lsp) GetMsg() string { data := res["data"].([]interface{}) uid := data[0].(map[string]interface{})["uid"].(float64) urls := data[0].(map[string]interface{})["urls"].(map[string]interface{}) - imgUrl := urls["mini"].(string) + imgUrl := urls["small"].(string) // title := data[0].(map[string]interface{})["title"].(string) // println("标题:" + title + "\n" + imgUrl) - msg := fmt.Sprintf("[CQ:reply,id=%s]Pixiv ID:%f", a.MID, uid) + msg := fmt.Sprintf("[CQ:reply,id=%s]Pixiv ID:%d", a.MID, int64(uid)) a.SendMsg(msg) - return fmt.Sprintf("[CQ:image,file=%s,type=flash]", imgUrl) + return fmt.Sprintf("[CQ:image,file=%s]", imgUrl) }