Skip to content

Commit f305ba0

Browse files
committed
feat: skip users on Slack when on holiday
1 parent 0b4d279 commit f305ba0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import (
1515
"github.com/slack-go/slack"
1616
)
1717

18+
const (
19+
slackStatusHoliday = "vacationing"
20+
)
21+
1822
func main() {
1923
ctx := context.Background()
2024

@@ -88,6 +92,11 @@ func main() {
8892
continue
8993
}
9094

95+
if strings.EqualFold(slackUser.Profile.StatusText, slackStatusHoliday) {
96+
logrus.WithField("slack_name", slackUser.Name).Warn("skipping user since he/she is on holiday")
97+
continue
98+
}
99+
91100
userFalconMsg := falconMessages[userEmail]
92101

93102
userWS1Msg := ws1Messages[userEmail]

0 commit comments

Comments
 (0)