|
|
@@ -6,7 +6,7 @@ using System.Text; |
|
|
|
namespace Discord.Commands |
|
|
|
{ |
|
|
|
[DebuggerDisplay(@"{DebuggerDisplay,nq}")] |
|
|
|
public class RuntimeResult : IResult |
|
|
|
public abstract class RuntimeResult : IResult |
|
|
|
{ |
|
|
|
protected RuntimeResult(CommandError? error, string reason) |
|
|
|
{ |
|
|
@@ -21,13 +21,6 @@ namespace Discord.Commands |
|
|
|
|
|
|
|
string IResult.ErrorReason => Reason; |
|
|
|
|
|
|
|
public static RuntimeResult FromSuccess(string reason = null) => |
|
|
|
new RuntimeResult(null, reason); |
|
|
|
public static RuntimeResult FromError(string reason) => |
|
|
|
new RuntimeResult(CommandError.Unsuccessful, reason); |
|
|
|
public static RuntimeResult FromError(IResult result) => |
|
|
|
new RuntimeResult(result.Error, result.ErrorReason); |
|
|
|
|
|
|
|
public override string ToString() => Reason ?? (IsSuccess ? "Successful" : "Unsuccessful"); |
|
|
|
private string DebuggerDisplay => IsSuccess ? $"Success: {Reason ?? "No Reason"}" : $"{Error}: {Reason}"; |
|
|
|
} |
|
|
|