Skip to content

Commit f94e635

Browse files
authored
Update dailynews.go
1 parent 7b10ff0 commit f94e635

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

plugin/dailynews/dailynews.go

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

44
import (
5-
"encoding/base64"
6-
75
"github.com/FloatTech/floatbox/web"
86
ctrl "github.com/FloatTech/zbpctrl"
97
"github.com/FloatTech/zbputils/control"
@@ -14,10 +12,10 @@ import (
1412
const api = "https://uapis.cn/api/v1/daily/news-image"
1513

1614
func init() {
17-
engine := control.Register("dailynews", &ctrl.Options[*zero.Ctx]{
18-
DisableOnDefault: false,
19-
Brief: "今日早报",
20-
Help: "- 今日早报",
15+
engine := control.AutoRegister(&ctrl.Options[*zero.Ctx]{
16+
DisableOnDefault: false,
17+
Brief: "今日早报",
18+
Help: "- 今日早报",
2119
PrivateDataFolder: "dailynews",
2220
})
2321

@@ -28,6 +26,6 @@ func init() {
2826
ctx.SendChain(message.Text("ERROR: ", err))
2927
return
3028
}
31-
ctx.SendChain(message.Image("base64://" + base64.StdEncoding.EncodeToString(data)))
29+
ctx.SendChain(message.ImageBytes(data))
3230
})
3331
}

0 commit comments

Comments
 (0)