mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
30 lines
806 B
Go
30 lines
806 B
Go
// Package aiwife 随机老婆
|
|
package aiwife
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
|
|
ctrl "github.com/FloatTech/zbpctrl"
|
|
"github.com/FloatTech/zbputils/control"
|
|
"github.com/FloatTech/zbputils/ctxext"
|
|
zero "github.com/wdvxdr1123/ZeroBot"
|
|
"github.com/wdvxdr1123/ZeroBot/message"
|
|
)
|
|
|
|
const (
|
|
bed = "https://www.thiswaifudoesnotexist.net/example-%d.jpg"
|
|
)
|
|
|
|
func init() { // 插件主体
|
|
control.AutoRegister(&ctrl.Options[*zero.Ctx]{
|
|
DisableOnDefault: false,
|
|
Brief: "ai随机生成老婆",
|
|
Help: "- waifu | 随机waifu",
|
|
}).ApplySingle(ctxext.DefaultSingle).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)))
|
|
})
|
|
}
|