@@ -116,11 +116,13 @@ func EvaluatePolls() {
116116 quorum := CalculateQuorum (* poll )
117117
118118 notVoted := make ([]* OIDCUser , 0 )
119+ notVotedString := make ([]string , 0 , len (notVoted ))
119120 votedCount := 0
120121 // check all voters to see if they have voted
121122 if poll .AllowedUsers == nil {
122123 logging .Logger .WithFields (logrus.Fields {"method" : "EvaluatePolls checkQuorum" }).Error (
123- "Users allowed to vote is nil for \" " + poll .Title + "\" !! This should not happen!!" )
124+ "Users allowed to vote is nil for \" " + poll .Title + "\" !! This should not happen!!" ,
125+ )
124126 continue
125127 }
126128 for _ , user := range poll .AllowedUsers {
@@ -144,11 +146,22 @@ func EvaluatePolls() {
144146 slack .MsgOptionText (
145147 "Hello, you have not yet voted on \" " + poll .Title + "\" . We have not yet hit quorum" +
146148 " and we need YOU :index_pointing_at_the_viewer: to complete your responsibility as a " +
147- "member of house and vote. \n " + pollLink + "\n Thank you!" , false ))
149+ "member of house and vote. \n " + pollLink + "\n Thank you!" , false ,
150+ ))
148151 if err != nil {
149152 logging .Logger .WithFields (logrus.Fields {"method" : "EvaluatePolls dm" }).Error (err )
150153 continue
151154 }
155+ notVotedString = append (notVotedString , "<@" + user .SlackUID + ">" )
156+ }
157+ // print non-voters to #announcements
158+ _ , _ , err = slackData .Client .PostMessage (slackData .AnnouncementsChannel ,
159+ slack .MsgOptionText ("It has been past the default time required to vote on \" " + poll .Title +
160+ "\" These people have not completed their responsibility as a Voting Member of House. \n " +
161+ strings .Join (notVotedString , "," ), false ))
162+ if err != nil {
163+ logging .Logger .WithFields (logrus.Fields {"method" : "EvaluatePolls notVoted announce" }).Error (err )
164+ continue
152165 }
153166 continue
154167 }
0 commit comments