public DatabaseNickMappingPlugin(IConnectionManager connMgr, JObject config) { ConnectionManager = connMgr; Config = new DatabaseNickMappingConfig(config); ConnectionManager.NickMapping += HandleNickMapping; ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler( new Command( CommandUtil.MakeNames("linknicks"), CommandUtil.NoOptions, CommandUtil.MakeArguments( CommandUtil.NonzeroStringMatcherRequiredWordTaker, // first nick (base) CommandUtil.NonzeroStringMatcherRequiredWordTaker // second nick (alias) ), forbiddenFlags: MessageFlags.UserBanned ), HandleLinkNicksCommand ); ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler( new Command( CommandUtil.MakeNames("unlinknick"), CommandUtil.NoOptions, CommandUtil.MakeArguments( CommandUtil.NonzeroStringMatcherRequiredWordTaker // nick ), forbiddenFlags: MessageFlags.UserBanned ), HandleUnlinkNickCommand ); ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler( new Command( CommandUtil.MakeNames("basenick"), CommandUtil.NoOptions, CommandUtil.MakeArguments( CommandUtil.NonzeroStringMatcherRequiredWordTaker // nick ), CommandUtil.MakeTags("fun"), forbiddenFlags: MessageFlags.UserBanned ), HandleBaseNickCommand ); ConnectionManager.CommandManager.RegisterChannelMessageCommandHandler( new Command( CommandUtil.MakeNames("pseudoregister", "pseudounregister"), CommandUtil.NoOptions, CommandUtil.MakeArguments( CommandUtil.NonzeroStringMatcherRequiredWordTaker // nick ), forbiddenFlags: MessageFlags.UserBanned ), HandlePseudoRegisterCommand ); }
public virtual void ReloadConfiguration(JObject newConfig) { Config = new DatabaseNickMappingConfig(newConfig); PostConfigReload(); }