Closed sztrzask closed 5 years ago
It's currently Seed with the time during each call, I believe -https://github.com/arkie/dicebot/blob/master/roll.go#L187
Let me know if it seems like that's not actually taking affect due to being outside the package, however.
Cool. Do you happen to know if slack provides correct time.Now()
for go or is it "frozen" like in go playground?
edit: nah, nevermind, it must work
time.Now
is actually evaluated on the server running the bot (i.e. in App Engine), Slack just triggers the request.
Hi,
I've noticed that rolls doesn't seem random.
I've checked
roll.go
file and I've noticed that you're missingSeed
call? Apparently you should seedrand
to minimize sequence and pattern occurrences .Reference https://stackoverflow.com/questions/39529364/go-rand-intn-same-number-value