mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
Update dailynews.go
This commit is contained in:
parent
7b10ff0e7d
commit
f94e635ff5
@ -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,10 +12,10 @@ 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: "- 今日早报",
|
||||||
PrivateDataFolder: "dailynews",
|
PrivateDataFolder: "dailynews",
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -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))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user