void LoadOptions(WinterBot bot) { Options options = bot.Options; m_options = options; m_chatOptions = options.ChatOptions; m_urlOptions = options.UrlOptions; m_capsOptions = options.CapsOptions; m_lengthOptions = options.LengthOptions; m_symbolOptions = options.SymbolOptions; m_emoteOptions = options.EmoteOptions; m_banWordOptions = options.BanWordOptions; // Load url lists m_urlWhitelist = new List<RegexMatch>(m_urlOptions.Whitelist.Select(s => new UrlMatch(bot, s))); m_urlBlacklist = new List<RegexMatch>(m_urlOptions.Blacklist.Select(s => new UrlMatch(bot, s))); m_urlBanlist = new List<RegexMatch>(m_urlOptions.Banlist.Select(s => new UrlMatch(bot, s))); m_wordBanlist = new List<RegexMatch>(m_banWordOptions.BanList.Select(s => new WordMatch(bot, s))); }
void LoadOptions(Options options) { m_options = options; m_chatOptions = options.ChatOptions; m_urlOptions = options.UrlOptions; m_capsOptions = options.CapsOptions; m_lengthOptions = options.LengthOptions; m_symbolOptions = options.SymbolOptions; m_emoteOptions = options.EmoteOptions; // Load url lists m_urlWhitelist = new List<Regex>(m_urlOptions.Whitelist.Select(s => new Regex(s, RegexOptions.IgnoreCase))); m_urlBlacklist = new List<Regex>(m_urlOptions.Blacklist.Select(s => new Regex(s, RegexOptions.IgnoreCase))); m_urlBanlist = new List<Regex>(m_urlOptions.Banlist.Select(s => new Regex(s, RegexOptions.IgnoreCase))); // Load URL extensions m_urlExtensions = new HashSet<string>(s_urlExtensions.Split(',')); }