✏️ 取消部分 @ 以免多次匹配

This commit is contained in:
fumiama 2021-09-09 00:45:49 +08:00
parent ebf58d4b73
commit cb3cfa054b
3 changed files with 12 additions and 12 deletions

View File

@ -103,16 +103,16 @@
- [x] 太涩了(撤回最近发的图) - [x] 太涩了(撤回最近发的图)
- [x] 评价图片(发送一张图片让bot评分) - [x] 评价图片(发送一张图片让bot评分)
- **浅草寺求签** `github.com/FloatTech/ZeroBot-Plugin/plugin_omikuji` - **浅草寺求签** `github.com/FloatTech/ZeroBot-Plugin/plugin_omikuji`
- [x] @BOT 求签|运势|占卜 - [x] 求签|运势|占卜
- **bilibili** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili"` - **bilibili** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili"`
- [x] >vup info [名字|uid] - [x] >vup info [名字|uid]
- [x] >user info [名字|uid] - [x] >user info [名字|uid]
- [x] /开启粉丝日报 - [x] /开启粉丝日报
- **嘉然** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_diana"` - **嘉然** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_diana"`
- [x] @BOT 小作文 - [x] 小作文
- [x] @BOT 发大病 - [x] 发大病
- [x] @BOT 教你一篇小作文[作文] - [x] 教你一篇小作文[作文]
= [x] [回复]查重 - [x] [回复]查重
- **AIfalse** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_ai_false"` - **AIfalse** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_ai_false"`
- [x] 查询计算机当前活跃度 [身体检查] - [x] 查询计算机当前活跃度 [身体检查]
- [ ] 简易语音 - [ ] 简易语音

View File

@ -18,20 +18,20 @@ func init() {
engine = control.Register("diana", &control.Options{ engine = control.Register("diana", &control.Options{
DisableOnDefault: false, DisableOnDefault: false,
Help: "嘉然\n" + Help: "嘉然\n" +
"- @BOT 小作文\n" + "- 小作文\n" +
"- @BOT 发大病\n" + "- 发大病\n" +
"- @BOT 教你一篇小作文[作文]\n" + "- 教你一篇小作文[作文]\n" +
"- [回复]查重", "- [回复]查重",
}) })
// 随机发送一篇上面的小作文 // 随机发送一篇上面的小作文
engine.OnFullMatch("小作文", zero.OnlyToMe). engine.OnFullMatch("小作文").
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
// 绕过第一行发病 // 绕过第一行发病
ctx.Send((*data.Array)[rand.Intn(len(*data.Array)-1)+1]) ctx.Send((*data.Array)[rand.Intn(len(*data.Array)-1)+1])
}) })
// 逆天 // 逆天
engine.OnFullMatch("发大病", zero.OnlyToMe). engine.OnFullMatch("发大病").
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
// 第一行是发病 // 第一行是发病
ctx.Send((*data.Array)[0]) ctx.Send((*data.Array)[0])

View File

@ -18,7 +18,7 @@ func init() { // 插件主体
// TODO: 1.17 特性暂不增加 // TODO: 1.17 特性暂不增加
// rand.Seed(time.Now().UnixMicro()) // rand.Seed(time.Now().UnixMicro())
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
zero.OnFullMatchGroup([]string{"求签", "运势", "占卜"}, zero.OnlyToMe).SetPriority(10). zero.OnFullMatchGroup([]string{"求签", "运势", "占卜"}).SetPriority(10).
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
miku := rand.Intn(100) + 1 miku := rand.Intn(100) + 1
ctx.SendChain( ctx.SendChain(