Skip to content

Commit

Permalink
don't check system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 11, 2023
1 parent 5dca418 commit f0c8388
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/bot/spam.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func NewSpamFilter(ctx context.Context, detector Detector, params SpamConfig) *S

// OnMessage checks if user already approved and if not checks if user is a spammer
func (s *SpamFilter) OnMessage(msg Message) (response Response) {
if msg.From.ID == 0 { // don't check system messages
return Response{}
}
displayUsername := DisplayName(msg)
isSpam, checkResults := s.director.Check(msg.Text, strconv.FormatInt(msg.From.ID, 10))
if isSpam {
Expand Down

0 comments on commit f0c8388

Please sign in to comment.