Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(potal): Do not sample slackbot messages #84

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions potal/internal/event/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ type MessageEvent struct {
}

func (e MessageEvent) isValid() bool {
// Only process messages with potato and not from a bot
return e.Amount > 0 && e.BotID == ""
// Only process messages with potato, not from a bot and not sent by slackbot
return e.Amount > 0 &&
e.BotID == "" &&
e.Sender != "USLACKBOT"
}

func ProcessMessageEvent(ctx context.Context, e *slackevents.MessageEvent, sc *slack.Client) *MessageEvent {
Expand Down
Loading