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); }
internal static bool NeedHighlight(Message m, ChatSettings chatSettings) { return(chatSettings.HighlightWords.Any(w => m.Text.Contains_IgnoreCase(w))); }
public Chat(IChatParser chatParser, ChatSettings settings) { _settings = settings ?? throw new ArgumentNullException(nameof(settings)); chatParser.NewMessage += ChatParser_NewMessage; }