reseed on drop

This commit is contained in:
skeletable 2022-10-16 12:52:57 +02:00
parent 1773b5c416
commit f120a9fa51
1 changed files with 3 additions and 2 deletions

View File

@ -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, "")
}
}