Update dailynews.go

This commit is contained in:
Kajiekazz 2025-09-30 19:46:38 +08:00 committed by GitHub
parent 7b10ff0e7d
commit f94e635ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,8 +2,6 @@
package dailynews package dailynews
import ( import (
"encoding/base64"
"github.com/FloatTech/floatbox/web" "github.com/FloatTech/floatbox/web"
ctrl "github.com/FloatTech/zbpctrl" ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control" "github.com/FloatTech/zbputils/control"
@ -14,7 +12,7 @@ import (
const api = "https://uapis.cn/api/v1/daily/news-image" const api = "https://uapis.cn/api/v1/daily/news-image"
func init() { func init() {
engine := control.Register("dailynews", &ctrl.Options[*zero.Ctx]{ engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{
DisableOnDefault: false, DisableOnDefault: false,
Brief: "今日早报", Brief: "今日早报",
Help: "- 今日早报", Help: "- 今日早报",
@ -28,6 +26,6 @@ func init() {
ctx.SendChain(message.Text("ERROR: ", err)) ctx.SendChain(message.Text("ERROR: ", err))
return return
} }
ctx.SendChain(message.Image("base64://" + base64.StdEncoding.EncodeToString(data))) ctx.SendChain(message.ImageBytes(data))
}) })
} }