Skip to content

Commit

Permalink
✏️ 暂时不使用 1.17 新特性
Browse files Browse the repository at this point in the history
  • Loading branch information
kanrichan committed Sep 6, 2021
1 parent 8233950 commit f3ddff7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion plugin_aiwife/non-existent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const (
)

func init() { // 插件主体
rand.Seed(time.Now().UnixMicro())
// TODO: 1.17 特性暂不增加
// rand.Seed(time.Now().UnixMicro())
rand.Seed(time.Now().UnixNano())
zero.OnFullMatchGroup([]string{"waifu", "随机waifu"}).SetPriority(10).
Handle(func(ctx *zero.Ctx) {
miku := rand.Intn(100000) + 1
Expand Down
10 changes: 8 additions & 2 deletions plugin_omikuji/sensou.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ const (
)

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

0 comments on commit f3ddff7

Please sign in to comment.