File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22package dailynews
33
44import (
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 (
1412const api = "https://uapis.cn/api/v1/daily/news-image"
1513
1614func 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}
You can’t perform that action at this time.
0 commit comments