Exemplo n.º 1
0
 public virtual void ReloadConfiguration(JObject newConfig)
 {
     Config = new ThanksConfig(newConfig);
     PostConfigReload();
 }
Exemplo n.º 2
0
        public ThanksPlugin(IConnectionManager connMgr, JObject config)
        {
            ConnectionManager = connMgr;
            Config            = new ThanksConfig(config);

            ConnectionManager.BaseNickChanged += HandleBaseNickChanged;

            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("thank", "thanks", "thx"),
                    CommandUtil.MakeOptions(
                        CommandUtil.MakeFlag("--force")
                        ),
                    CommandUtil.MakeArguments(
                        CommandUtil.NonzeroStringMatcherRequiredWordTaker, // target
                        RestTaker.Instance                                 // reason
                        ),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleThankCommand
                );
            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("thanked"),
                    CommandUtil.MakeOptions(
                        CommandUtil.MakeFlag("--raw")
                        ),
                    CommandUtil.MakeArguments(
                        CommandUtil.NonzeroStringMatcherRequiredWordTaker // target
                        ),
                    CommandUtil.MakeTags("fun"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleThankedCommand
                );
            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("grateful"),
                    CommandUtil.MakeOptions(
                        CommandUtil.MakeFlag("--raw")
                        ),
                    CommandUtil.MakeArguments(
                        CommandUtil.NonzeroStringMatcherRequiredWordTaker // target
                        ),
                    CommandUtil.MakeTags("fun"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleGratefulCommand
                );
            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("topthanked"),
                    tags: CommandUtil.MakeTags("fun"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleTopThankedCommand
                );
            ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler(
                new Command(
                    CommandUtil.MakeNames("topgrateful"),
                    tags: CommandUtil.MakeTags("fun"),
                    forbiddenFlags: MessageFlags.UserBanned
                    ),
                HandleTopGratefulCommand
                );
        }