Skip to content

Commit

Permalink
add spamscore to activity tags (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
zawodskoj authored Jun 13, 2024
1 parent 7bbb7c5 commit 13eb42a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/VahterBanBot/Bot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -489,17 +489,17 @@ let onUpdate

// if message is not a command from authorized user, just save it ID to DB
else
if message.Text <> null then
let spamScore = calcSpamScore message.Text
let spamScore = if message.Text <> null then calcSpamScore message.Text else 0

if spamScore >= 100 then
do! warnSpamDetection botClient botConfig message logger spamScore
if spamScore >= 100 then
do! warnSpamDetection botClient botConfig message logger spamScore

use _ =
botActivity
.StartActivity("justMessage")
.SetTag("fromUserId", message.From.Id)
.SetTag("fromUsername", message.From.Username)
.SetTag("spamScore", spamScore)
do!
message
|> DbMessage.newMessage
Expand Down

0 comments on commit 13eb42a

Please sign in to comment.