summaryrefslogtreecommitdiff
path: root/members.go
diff options
context:
space:
mode:
Diffstat (limited to 'members.go')
-rw-r--r--members.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/members.go b/members.go
index 2886bed..81f0f15 100644
--- a/members.go
+++ b/members.go
@@ -5,19 +5,14 @@ import (
"time"
)
-func getRandomMember() string {
+func getRandomMember(team []string, except string) string {
rand.Seed(time.Now().Unix())
- team := []string{
- "<@U8UJT0UJX>",
- "<@UCF7JA5CZ>",
- "<@UC86HMG1G>",
- "<@UCFHM9G04>",
- "<@UC9GZ0C2J>",
+ ok := false
+ member := ""
+ for !ok {
+ n := rand.Int() % len(team)
+ member = team[n]
+ ok = member != except
}
-
- n := rand.Int() % len(team)
- member := team[n]
-
return member
}
-