mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-22 16:20:08 +08:00
* Update calendar.go
更换API方式
* Update calendar.go
* 更换API
修复BUG
* 🎨 改进代码样式
Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
29 lines
778 B
Go
29 lines
778 B
Go
// Package moyucalendar 摸鱼人日历
|
|
package moyucalendar
|
|
|
|
import (
|
|
control "github.com/FloatTech/zbputils/control"
|
|
"github.com/FloatTech/zbputils/web"
|
|
zero "github.com/wdvxdr1123/ZeroBot"
|
|
"github.com/wdvxdr1123/ZeroBot/message"
|
|
)
|
|
|
|
func init() {
|
|
control.Register("moyucalendar", &control.Options{
|
|
DisableOnDefault: true,
|
|
Help: "摸鱼人日历\n" +
|
|
"- /启用 moyucalendar\n" +
|
|
"- /禁用 moyucalendar\n" +
|
|
"- 记录在\"30 8 * * *\"触发的指令\n" +
|
|
" - 摸鱼人日历",
|
|
}).OnFullMatch("摸鱼人日历").SetBlock(true).
|
|
Handle(func(ctx *zero.Ctx) {
|
|
data, err := web.GetData("https://api.vvhan.com/api/moyu")
|
|
if err != nil {
|
|
ctx.SendChain(message.Text("ERROR:", err))
|
|
return
|
|
}
|
|
ctx.SendChain(message.ImageBytes(data))
|
|
})
|
|
}
|