Skip to content

Commit

Permalink
避免伪随机
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jun 16, 2021
1 parent 4bd2d8f commit 3d3da9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"math/rand"
"strconv"
"strings"
"time"

timer "github.com/fumiama/ZeroBot-Plugin-Timer"
zero "github.com/wdvxdr1123/ZeroBot"
Expand Down Expand Up @@ -269,6 +270,7 @@ func init() { // 插件主体
Handle(func(ctx *zero.Ctx) {
if ctx.Event.GroupID > 0 {
list := ctx.GetGroupMemberList(ctx.Event.GroupID)
rand.Seed(time.Now().UnixNano())
rand_index := fmt.Sprint(rand.Intn(int(list.Get("#").Int())))
random_card := list.Get(rand_index + ".card").String()
if random_card == "" {
Expand Down

0 comments on commit 3d3da9a

Please sign in to comment.