示例#1
0
        public AllographPlugin(IConnectionManager connMgr, JObject config)
        {
            ConnectionManager   = connMgr;
            Config              = new AllographConfig(config);
            Random              = new Random();
            CooldownsPerChannel = new Dictionary <string, List <int> >();
            ReplacerRegexes     = new List <ReplacerRegex>();

            RecompileReplacerRegexes();

            ConnectionManager.ChannelMessage += HandleChannelMessage;

            ConnectionManager.CommandManager.RegisterQueryMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("allostats"),
                    CommandUtil.NoOptions,
                    CommandUtil.MakeArguments(
                        new RegexMatcher("^[#&]\\S{1,256}$").ToRequiredWordTaker(), // channel name
                        RestTaker.Instance                                          // test message (optional)
                        ),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleAlloStatsCommand
                );
        }
示例#2
0
 public virtual void ReloadConfiguration(JObject newConfig)
 {
     Config = new AllographConfig(newConfig);
     PostConfigReload();
 }