Пример #1
0
        private string GetBotTypeString()
        {
            var classification = Tracker.Current.Contact.System.Classification;

            if (ContactClassification.IsMaliciousRobot(classification))
            {
                return($"Malicious robot ({classification})");
            }

            if (ContactClassification.IsAutoDetectedRobot(classification))
            {
                return($"Auto detected robot ({classification})");
            }

            if (ContactClassification.IsRobot(classification))
            {
                return($"Robot ({classification})");
            }

            if (ContactClassification.IsHuman(classification))
            {
                return($"Human ({classification})");
            }

            return(string.Empty);
        }
Пример #2
0
 public void Process(ValidateCommentArgs args)
 {
     if (ContactClassification.IsRobot(Tracker.Current.Contact.System.Classification))
     {
         var text = Translator.Text(Constants.TranslationPhrases.ErrorOccurredTryAgain);
         args.Errors.Add(text);
     }
 }