From a89ca96992ac3a7f5f11ff08ac692fc45f6ec9f2 Mon Sep 17 00:00:00 2001 From: shaeespring Date: Fri, 2 Oct 2026 11:39:52 -0400 Subject: [PATCH 1/3] People don't wanna vote and I don't get why --- constitutional.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/constitutional.go b/constitutional.go index c16c18f..a179a21 100644 --- a/constitutional.go +++ b/constitutional.go @@ -116,11 +116,13 @@ func EvaluatePolls() { quorum := CalculateQuorum(*poll) notVoted := make([]*OIDCUser, 0) + notVotedString := make([]string, 0, len(notVoted)) votedCount := 0 // check all voters to see if they have voted if poll.AllowedUsers == nil { logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls checkQuorum"}).Error( - "Users allowed to vote is nil for \"" + poll.Title + "\" !! This should not happen!!") + "Users allowed to vote is nil for \"" + poll.Title + "\" !! This should not happen!!", + ) continue } for _, user := range poll.AllowedUsers { @@ -144,11 +146,22 @@ func EvaluatePolls() { slack.MsgOptionText( "Hello, you have not yet voted on \""+poll.Title+"\". We have not yet hit quorum"+ " and we need YOU :index_pointing_at_the_viewer: to complete your responsibility as a "+ - "member of house and vote. \n"+pollLink+"\nThank you!", false)) + "member of house and vote. \n"+pollLink+"\nThank you!", false, + )) if err != nil { logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls dm"}).Error(err) continue } + notVotedString = append(notVotedString, "<@"+user.SlackUID+">") + } + // print non-voters to #announcements + _, _, err = slackData.Client.PostMessage(slackData.AnnouncementsChannel, + slack.MsgOptionText("It has been past the default time required to vote on \""+poll.Title+ + "\" These people have not completed their responsibility as a Voting Member of House. \n"+ + strings.Join(notVotedString, ","), false)) + if err != nil { + logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls notVoted announce"}).Error(err) + continue } continue } From 14cac0bf07b55aee73ff021c34c66760d65a25ad Mon Sep 17 00:00:00 2001 From: shaeespring Date: Fri, 2 Oct 2026 18:39:57 -0400 Subject: [PATCH 2/3] public shaming grace period --- constitutional.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/constitutional.go b/constitutional.go index a179a21..ee2d325 100644 --- a/constitutional.go +++ b/constitutional.go @@ -116,7 +116,7 @@ func EvaluatePolls() { quorum := CalculateQuorum(*poll) notVoted := make([]*OIDCUser, 0) - notVotedString := make([]string, 0, len(notVoted)) + notVotedString := make([]string, 0) votedCount := 0 // check all voters to see if they have voted if poll.AllowedUsers == nil { @@ -154,14 +154,16 @@ func EvaluatePolls() { } notVotedString = append(notVotedString, "<@"+user.SlackUID+">") } - // print non-voters to #announcements - _, _, err = slackData.Client.PostMessage(slackData.AnnouncementsChannel, - slack.MsgOptionText("It has been past the default time required to vote on \""+poll.Title+ - "\" These people have not completed their responsibility as a Voting Member of House. \n"+ - strings.Join(notVotedString, ","), false)) - if err != nil { - logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls notVoted announce"}).Error(err) - continue + // print non-voters to #announcements if we can't close the vote + if !poll.OpenedTime.AddDate(0, 0, 2).After(now) { + _, _, err = slackData.Client.PostMessage(slackData.AnnouncementsChannel, + slack.MsgOptionText("It has been past the default time required to vote on \""+poll.Title+ + "\" These people have not completed their responsibility as a Voting Member of House. \n"+ + strings.Join(notVotedString, ","), false)) + if err != nil { + logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls notVoted announce"}).Error(err) + continue + } } continue } From 6a0a8bf723e1db866e0b734c38673a7ce7dec9aa Mon Sep 17 00:00:00 2001 From: shaeespring Date: Sat, 3 Oct 2026 11:26:56 -0400 Subject: [PATCH 3/3] (fix) nits and correctness --- constitutional.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/constitutional.go b/constitutional.go index ee2d325..4d77fd3 100644 --- a/constitutional.go +++ b/constitutional.go @@ -148,18 +148,22 @@ func EvaluatePolls() { " and we need YOU :index_pointing_at_the_viewer: to complete your responsibility as a "+ "member of house and vote. \n"+pollLink+"\nThank you!", false, )) + if user.SlackUID != "" { + notVotedString = append(notVotedString, "<@"+user.SlackUID+">") + } else { + notVotedString = append(notVotedString, user.Username) + } if err != nil { logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls dm"}).Error(err) continue } - notVotedString = append(notVotedString, "<@"+user.SlackUID+">") } // print non-voters to #announcements if we can't close the vote if !poll.OpenedTime.AddDate(0, 0, 2).After(now) { _, _, err = slackData.Client.PostMessage(slackData.AnnouncementsChannel, slack.MsgOptionText("It has been past the default time required to vote on \""+poll.Title+ "\" These people have not completed their responsibility as a Voting Member of House. \n"+ - strings.Join(notVotedString, ","), false)) + strings.Join(notVotedString, ", "), false)) if err != nil { logging.Logger.WithFields(logrus.Fields{"method": "EvaluatePolls notVoted announce"}).Error(err) continue