mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 02:00:24 +00:00
fix gitcode 图床
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/FloatTech/zbputils/img/text"
|
||||
)
|
||||
|
||||
const bed = "https://gitcode.net/u011570312/senso-ji-omikuji/-/raw/main/%d_%d.jpg"
|
||||
const bed = "https://gitcode.net/u011570312/senso-ji-omikuji/-/raw/main/"
|
||||
|
||||
func init() { // 插件主体
|
||||
engine := control.Register("omikuji", &ctrl.Options[*zero.Ctx]{
|
||||
@@ -30,10 +30,20 @@ func init() { // 插件主体
|
||||
engine.OnFullMatchGroup([]string{"求签", "占卜"}).SetBlock(true).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
i := fcext.RandSenderPerDayN(ctx.Event.UserID, 100) + 1
|
||||
img0, err := engine.GetCustomLazyData(bed, fmt.Sprintf("%d_%d.jpg", i, 0))
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text("ERROR: ", err))
|
||||
return
|
||||
}
|
||||
img1, err := engine.GetCustomLazyData(bed, fmt.Sprintf("%d_%d.jpg", i, 1))
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text("ERROR: ", err))
|
||||
return
|
||||
}
|
||||
ctx.SendChain(
|
||||
message.At(ctx.Event.UserID),
|
||||
message.Image(fmt.Sprintf(bed, i, 0)),
|
||||
message.Image(fmt.Sprintf(bed, i, 1)),
|
||||
message.ImageBytes(img0),
|
||||
message.ImageBytes(img1),
|
||||
)
|
||||
})
|
||||
engine.OnFullMatch("解签", fcext.DoOnceOnSuccess(
|
||||
|
||||
Reference in New Issue
Block a user