增加浅草寺求签插件

This commit is contained in:
fumiama
2021-08-25 21:22:36 +08:00
parent 6994b27656
commit 33b00f369f
3 changed files with 24 additions and 0 deletions

21
plugin_omikuji/sensou.go Normal file
View File

@@ -0,0 +1,21 @@
package omikuji
import (
"fmt"
"math/rand"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
)
const (
bed = "https://codechina.csdn.net/u011570312/senso-ji-omikuji/-/raw/main/%d_%d.jpg"
)
func init() { // 插件主体
zero.OnFullMatchGroup([]string{"求签", "运势", "占卜"}, zero.OnlyToMe).
Handle(func(ctx *zero.Ctx) {
miku := rand.Intn(100) + 1
ctx.SendChain(message.Image(fmt.Sprintf(bed, miku, 0)), message.Image(fmt.Sprintf(bed, miku, 1)))
})
}