예제 #1
0
 public static CommandPipelineBuilder UseLocalization(
     this CommandPipelineBuilder builder)
 {
     return(builder.UseStage(
                new LocalizationPipelineStage(
                    builder.Services.GetRequiredService <ILocalizationService>())));
 }
예제 #2
0
 public static CommandPipelineBuilder UsePrefixes(
     this CommandPipelineBuilder builder)
 {
     return(builder.UseStage(
                new PipelineStageTrigger(
                    builder.Services.GetService <IPrefixService>())));
 }
예제 #3
0
 public static CommandPipelineBuilder UseStates(
     this CommandPipelineBuilder builder,
     StatePipelineStage.StateConfiguration config = null)
 {
     if (config == null)
     {
         config = new StatePipelineStage.StateConfiguration();
     }
     return(builder.UseStage(new StatePipelineStage(config)));
 }
예제 #4
0
        /// <summary>
        /// Initializes the permissions system at this index on your CommandPipeline. Permissions will
        /// give users a way to manage their entire command infrastructure in a ACL kind of manner.
        ///
        /// This stage requires you to already have set an Executable to work properly.
        /// </summary>
        public static CommandPipelineBuilder UsePermissions(this CommandPipelineBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.UseStage(
                new PermissionPipelineStage(
                    builder.Services.GetRequiredService <PermissionService>()));
            return(builder);
        }
예제 #5
0
 /// <summary>
 /// Enable the feature to create feature-flag like scopes to allow specific users to specific
 /// commands.
 /// </summary>
 public static CommandPipelineBuilder UseScopes(this CommandPipelineBuilder builder)
 {
     return(builder.UseStage(
                new ScopePipelineStage(builder.Services.GetService <IScopeService>())));
 }
예제 #6
0
 /// <summary>
 /// Allows you to use FIFO-like argument readers. Used in other packages as a dependency. With
 /// non-default providers if you prefer overriding default implementation.
 /// </summary>
 public static CommandPipelineBuilder UseArgumentPack(
     this CommandPipelineBuilder builder, ArgumentParseProvider provider)
 {
     return(builder.UseStage(new ArgumentPackBuilder(provider)));
 }