ZeroBot-Plugin/plugin_diana/bing.go
2021-08-06 18:56:26 +08:00

38 lines
1.1 KiB
Go
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package diana 虚拟偶像女团 A-SOUL 成员嘉然相关
package diana
import (
fmt "fmt"
"math/rand"
"time"
"github.com/FloatTech/ZeroBot-Plugin/plugin_diana/data"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
)
const yamai = "贝拉抽我\u200b嘉然骑在我背上\u200b晚晚踩我\u200b乃琳坐在王座是用看垃圾的眼神看我\u200b\u200b珈乐踢我\u200b\u200b把我眼睛蒙住然后五只脚一起踩我\u200b还让我猜脚是谁的猜错了给我劈眼一铁棍\u200b"
func init() {
// 随机发送一篇上面的小作文
zero.OnFullMatch("小作文", zero.OnlyToMe).
Handle(func(ctx *zero.Ctx) {
rand.Seed(time.Now().UnixNano())
ctx.SendChain(message.Text(data.Array[rand.Intn(len(data.Array))]))
})
// 逆天
zero.OnFullMatch("发大病", zero.OnlyToMe).
Handle(func(ctx *zero.Ctx) {
ctx.Send(yamai)
})
// 增加小作文
zero.OnRegex(`^教你一篇小作文(.*)$`, zero.AdminPermission).
Handle(func(ctx *zero.Ctx) {
err := data.AddText(ctx.State["regex_matched"].([]string)[1])
if err != nil {
ctx.Send(fmt.Sprintf("ERROR: %v", err))
}
})
}