diff options
author | Alexander Kiryukhin <alexander@kiryukhin.su> | 2019-02-01 01:20:38 +0300 |
---|---|---|
committer | Alexander Kiryukhin <alexander@kiryukhin.su> | 2019-02-01 01:20:38 +0300 |
commit | 8c499a32b7bb614814da84bace3f3e924be92465 (patch) | |
tree | 3bc9d97a01fdb6e4bf219d5de81f1873232fe696 /members.go | |
parent | fc9aefc97d872ec8faed767a7b9e2a89ee8630f0 (diff) |
fixes
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 } - |