reseed on drop
This commit is contained in:
parent
1773b5c416
commit
f120a9fa51
5
main.go
5
main.go
|
@ -217,9 +217,8 @@ func candy(s *discordgo.Session, channel string, droptype string) {
|
|||
|
||||
drop := candy1
|
||||
if droptype == "" {
|
||||
rand.Seed(time.Now().Unix())
|
||||
switch rand.Intn(40) {
|
||||
case 1, 2:
|
||||
case 1:
|
||||
drop = candyCaptain
|
||||
case 3, 4:
|
||||
drop = candyMilky
|
||||
|
@ -789,6 +788,8 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||
if m.ChannelID == "946459086554275883" {
|
||||
rand.Seed(time.Now().Unix())
|
||||
if rand.Intn(100) < 3 {
|
||||
time.Sleep(1 * time.Second)
|
||||
rand.Seed(time.Now().Unix() - rand.Int63n(time.Now().Unix()))
|
||||
candy(s, m.ChannelID, "")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue