diff options
Diffstat (limited to 'members.go')
-rw-r--r-- | members.go | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -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 } - |