Exemple #1
0
        internal static bool NeedHide(Message m, ChatSettings settings)
        {
            foreach (var ignoreWord in settings.IgnoreWords)
            {
                if (ignoreWord.Contains('+'))
                {
                    var iWords = ignoreWord.Split('+');
                    if (iWords.All(iw => m.Text.Contains_IgnoreCase(iw)))
                    {
                        return(true);
                    }
                }
                else
                {
                    if (m.Text.Contains_IgnoreCase(ignoreWord))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #2
0
 internal static bool NeedHighlight(Message m, ChatSettings chatSettings)
 {
     return(chatSettings.HighlightWords.Any(w => m.Text.Contains_IgnoreCase(w)));
 }
Exemple #3
0
 public Chat(IChatParser chatParser, ChatSettings settings)
 {
     _settings              = settings ?? throw new ArgumentNullException(nameof(settings));
     chatParser.NewMessage += ChatParser_NewMessage;
 }