Add check for extended_latin and links
This commit is contained in:
parent
af46dbe003
commit
4f6f70afad
1 changed files with 84 additions and 78 deletions
6
bot.go
6
bot.go
|
|
@ -313,6 +313,11 @@ func handleNewMessage(ctx context.Context, api *tg.Client, alertPeer *tg.InputPe
|
|||
return nil
|
||||
}
|
||||
|
||||
if result.score == 1.0 ||
|
||||
(result.score == 1.0 &&
|
||||
result.matchedKeywords["extended_latin"] != nil &&
|
||||
len(result.matchedKeywords["links"]) > 0) {
|
||||
|
||||
log.Printf("Matched message with score %.2f", result.score)
|
||||
for key, values := range result.matchedKeywords {
|
||||
for _, value := range values {
|
||||
|
|
@ -403,6 +408,7 @@ func handleNewMessage(ctx context.Context, api *tg.Client, alertPeer *tg.InputPe
|
|||
if err != nil {
|
||||
log.Printf("Failed to send alert message: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue