From f0c83884840d732847ccbbdcc612238e2242face Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 11 Dec 2023 15:16:00 -0600 Subject: [PATCH] don't check system messages --- app/bot/spam.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/bot/spam.go b/app/bot/spam.go index a4a46db9..eec2d542 100644 --- a/app/bot/spam.go +++ b/app/bot/spam.go @@ -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 {