Skip to content

Commit fef48e4

Browse files
authored
fix(dailynews): update to new API (#1230)
1 parent 2d1603d commit fef48e4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

plugin/dailynews/dailynews.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
package dailynews
33

44
import (
5-
"github.com/FloatTech/floatbox/binary"
65
"github.com/FloatTech/floatbox/web"
76
ctrl "github.com/FloatTech/zbpctrl"
87
"github.com/FloatTech/zbputils/control"
9-
"github.com/tidwall/gjson"
108
zero "github.com/wdvxdr1123/ZeroBot"
119
"github.com/wdvxdr1123/ZeroBot/message"
1210
)
1311

14-
const api = "http://dwz.2xb.cn/zaob"
12+
const api = "https://uapis.cn/api/v1/daily/news-image"
1513

1614
func init() {
1715
engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{
@@ -28,7 +26,6 @@ func init() {
2826
ctx.SendChain(message.Text("ERROR: ", err))
2927
return
3028
}
31-
picURL := gjson.Get(binary.BytesToString(data), "imageUrl").String()
32-
ctx.SendChain(message.Image(picURL))
29+
ctx.SendChain(message.ImageBytes(data))
3330
})
3431
}

0 commit comments

Comments
 (0)