From 33e95eed13306668c060527d795adbad3129c11f Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sat, 16 Oct 2021 18:24:15 +0200 Subject: [PATCH] add random number generator over range --- pkg/utils/utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 523043f..e5dae76 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -49,6 +49,10 @@ func GenerateRandomNumber(max int) int { return rand.Intn(max) } +func GenerateRandomNumberRange(min int, max int) int { + return (rand.Intn(max-min) + min) +} + // ElevatedPrivsMessage is checking a given message twitch.PrivateMessage // if it came from a moderator/vip/or broadcaster and returns a bool func ElevatedPrivsMessage(message twitch.PrivateMessage) bool {