Example #1
0
        public TriviaPlugin(IConnectionManager connMgr, JObject config)
        {
            ConnectionManager = connMgr;
            Config            = new TriviaConfig(config);
            GameState         = null;
            Randomizer        = new Random();

            ConnectionManager.ChannelMessage  += HandleChannelMessage;
            ConnectionManager.BaseNickChanged += HandleBaseNickChanged;

            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("question"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleQuestionCommand
                );
            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("starttrivia"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleStartTriviaCommand
                );
            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("stoptrivia"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleStopTriviaCommand
                );
        }
Example #2
0
 public virtual void ReloadConfiguration(JObject newConfig)
 {
     Config = new TriviaConfig(newConfig);
     PostConfigReload();
 }