Example #1
0
 private static ICommandResult ProcessCommand(IUser user, IPlugin plugin, string commandLine, ICommandResult previousResullt)
 {
     try
     {
         return SafeProcessCommand(user, plugin, commandLine, previousResullt);
     }
     catch(Exception ex)
     {
         return CommandResult.Exception(ex);
     }
 }
Example #2
0
 private static ICommandResult SafeProcessCommand(IUser user, IPlugin plugin, string commandLine, ICommandResult previousResullt)
 {
     var ctx = PipedContextFor(plugin, user, commandLine, previousResullt);
     return plugin.ExecuteCommand(GetCommandName(commandLine), ctx);
 }
Example #3
0
 private static IContext PipedContextFor(IPlugin plugin, IUser user, string commandLine, ICommandResult result)
 {
     var passedArguments = CommandParameters(commandLine);
     return result.PipeThrough(passedArguments, pipedArgs => new Context(user, plugin, pipedArgs));
 }