ZeroBot-Plugin/plugin_aiwife/non-existent.go
fumiama 4519dd5eb8 💫 ♻️ 🎉 ️ 强制使用优先级
2022-01-15 20:14:34 +08:00

33 lines
836 B
Go

// Package aiwife 随机老婆
package aiwife
import (
"fmt"
"math/rand"
"time"
"github.com/FloatTech/ZeroBot-Plugin/order"
control "github.com/FloatTech/zbputils/control"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
)
const (
bed = "https://www.thiswaifudoesnotexist.net/example-%d.jpg"
)
func init() { // 插件主体
// TODO: 1.17 特性暂不增加
// rand.Seed(time.Now().UnixMicro())
rand.Seed(time.Now().UnixNano())
control.Register("aiwife", order.PrioAIWife, &control.Options{
DisableOnDefault: false,
Help: "AIWife\n" +
"- waifu|随机waifu",
}).OnFullMatchGroup([]string{"waifu", "随机waifu"}).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
miku := rand.Intn(100000) + 1
ctx.SendChain(message.At(ctx.Event.UserID), message.Image(fmt.Sprintf(bed, miku)))
})
}