From 6137a371d2b1d41c3ba1f20e008610c4799e78a3 Mon Sep 17 00:00:00 2001 From: Kajiekazz <145256947+Kajiekazz@users.noreply.github.com> Date: Sun, 28 Sep 2025 23:18:46 +0800 Subject: [PATCH 1/3] Update dailynews.go --- plugin/dailynews/dailynews.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugin/dailynews/dailynews.go b/plugin/dailynews/dailynews.go index 23fe37d628..bc5f713e6f 100644 --- a/plugin/dailynews/dailynews.go +++ b/plugin/dailynews/dailynews.go @@ -2,22 +2,22 @@ package dailynews import ( - "github.com/FloatTech/floatbox/binary" + "encoding/base64" + "github.com/FloatTech/floatbox/web" ctrl "github.com/FloatTech/zbpctrl" "github.com/FloatTech/zbputils/control" - "github.com/tidwall/gjson" zero "github.com/wdvxdr1123/ZeroBot" "github.com/wdvxdr1123/ZeroBot/message" ) -const api = "http://dwz.2xb.cn/zaob" +const api = "https://uapis.cn/api/v1/daily/news-image" func init() { - engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{ - DisableOnDefault: false, - Brief: "今日早报", - Help: "- 今日早报", + engine := control.Register("dailynews", &ctrl.Options[*zero.Ctx]{ + DisableOnDefault: false, + Brief: "今日早报", + Help: "- 今日早报", PrivateDataFolder: "dailynews", }) @@ -28,7 +28,6 @@ func init() { ctx.SendChain(message.Text("ERROR: ", err)) return } - picURL := gjson.Get(binary.BytesToString(data), "imageUrl").String() - ctx.SendChain(message.Image(picURL)) + ctx.SendChain(message.Image("base64://" + base64.StdEncoding.EncodeToString(data))) }) } From 7b10ff0e7d7edf408b62960a09bc2d4f9b0dc473 Mon Sep 17 00:00:00 2001 From: Kajiekazz <145256947+Kajiekazz@users.noreply.github.com> Date: Sun, 28 Sep 2025 23:20:18 +0800 Subject: [PATCH 2/3] Update dailynews.go From f94e635ff586f6e3f7723fb6885bbb5b0dbbb416 Mon Sep 17 00:00:00 2001 From: Kajiekazz <145256947+Kajiekazz@users.noreply.github.com> Date: Tue, 30 Sep 2025 19:46:38 +0800 Subject: [PATCH 3/3] Update dailynews.go --- plugin/dailynews/dailynews.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugin/dailynews/dailynews.go b/plugin/dailynews/dailynews.go index bc5f713e6f..f5a0d7cbfc 100644 --- a/plugin/dailynews/dailynews.go +++ b/plugin/dailynews/dailynews.go @@ -2,8 +2,6 @@ package dailynews import ( - "encoding/base64" - "github.com/FloatTech/floatbox/web" ctrl "github.com/FloatTech/zbpctrl" "github.com/FloatTech/zbputils/control" @@ -14,10 +12,10 @@ import ( const api = "https://uapis.cn/api/v1/daily/news-image" func init() { - engine := control.Register("dailynews", &ctrl.Options[*zero.Ctx]{ - DisableOnDefault: false, - Brief: "今日早报", - Help: "- 今日早报", + engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{ + DisableOnDefault: false, + Brief: "今日早报", + Help: "- 今日早报", PrivateDataFolder: "dailynews", }) @@ -28,6 +26,6 @@ func init() { ctx.SendChain(message.Text("ERROR: ", err)) return } - ctx.SendChain(message.Image("base64://" + base64.StdEncoding.EncodeToString(data))) + ctx.SendChain(message.ImageBytes(data)) }) }