fix(dailynews): update to new API (#1230)
Some checks failed
自动更新 nix 依赖 / gomod2nix update (push) Has been cancelled
最新版 / Build binary CI (386, linux) (push) Has been cancelled
最新版 / Build binary CI (386, windows) (push) Has been cancelled
最新版 / Build binary CI (amd64, linux) (push) Has been cancelled
最新版 / Build binary CI (amd64, windows) (push) Has been cancelled
最新版 / Build binary CI (arm, linux) (push) Has been cancelled
最新版 / Build binary CI (arm64, linux) (push) Has been cancelled
PushLint / lint (push) Has been cancelled

This commit is contained in:
Kajiekazz 2025-10-01 01:05:31 +08:00 committed by GitHub
parent 2d1603d65a
commit fef48e405a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,16 +2,14 @@
package dailynews
import (
"github.com/FloatTech/floatbox/binary"
"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]{
@ -28,7 +26,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.ImageBytes(data))
})
}