Skip to content

Commit

Permalink
✏️ 增加 Diana 插件保存反馈
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Sep 8, 2021
1 parent 0bffc38 commit bbc96a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugin_diana/bing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import (
"math/rand"
"time"

zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"

"github.com/FloatTech/ZeroBot-Plugin/plugin_diana/data"
zero "github.com/wdvxdr1123/ZeroBot"
)

func init() {
Expand All @@ -18,7 +16,7 @@ func init() {
Handle(func(ctx *zero.Ctx) {
rand.Seed(time.Now().UnixNano())
// 绕过第一行发病
ctx.SendChain(message.Text((*data.Array)[rand.Intn(len(*data.Array)-1)+1]))
ctx.Send((*data.Array)[rand.Intn(len(*data.Array)-1)+1])
})
// 逆天
zero.OnFullMatch("发大病", zero.OnlyToMe).
Expand All @@ -32,6 +30,8 @@ func init() {
err := data.AddText(ctx.State["regex_matched"].([]string)[1])
if err != nil {
ctx.Send(fmt.Sprintf("ERROR: %v", err))
} else {
ctx.Send("记住啦!")
}
})
}
2 changes: 1 addition & 1 deletion plugin_diana/data/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func AddText(txt string) error {
if txt != "" && !isin(sum) {
compo.Array = append(compo.Array, txt)
md5s = append(md5s, sum)
savecompo()
return savecompo()
}
return nil
}
Expand Down

0 comments on commit bbc96a8

Please sign in to comment.