public static ParseResult FromError(InteractionCommandError error, string reason) => new ParseResult(null, error, reason);
/// <summary> /// Initializes a new <see cref="SearchResult{T}" /> with a specified <see cref="InteractionCommandError" /> and its /// reason, indicating an unsuccessful execution. /// </summary> /// <param name="error">The type of error.</param> /// <param name="reason">The reason behind the error.</param> /// <returns> /// A <see cref="SearchResult{T}" /> that contains a <see cref="InteractionCommandError" /> and reason. /// </returns> public static SearchResult <T> FromError(string text, InteractionCommandError error, string reason) => new SearchResult <T>(text, null, null, error, reason);
/// <summary> /// Returns a <see cref="PreconditionResult" /> with the specified error and the reason. /// </summary> /// <param name="error">The type of error.</param> /// <param name="reason">The reason of failure.</param> public static TypeConverterResult FromError(InteractionCommandError error, string reason) => new TypeConverterResult(null, error, reason);
/// <summary> /// Initializes a new <see cref="AutocompletionResult" /> with a specified <see cref="InteractionCommandError" /> and its /// reason, indicating an unsuccessful execution. /// </summary> /// <param name="error">The type of error.</param> /// <param name="reason">The reason behind the error.</param> /// <returns> /// A <see cref="AutocompletionResult" /> that contains a <see cref="InteractionCommandError" /> and reason. /// </returns> public static AutocompletionResult FromError(InteractionCommandError error, string reason) => new AutocompletionResult(null, error, reason);
/// <summary> /// Initializes a new <see cref="ExecuteResult" /> with a specified <see cref="InteractionCommandError" /> and its /// reason, indicating an unsuccessful execution. /// </summary> /// <param name="commandError">The type of error.</param> /// <param name="reason">The reason behind the error.</param> /// <returns> /// A <see cref="ExecuteResult" /> that contains a <see cref="InteractionCommandError" /> and reason. /// </returns> public static ExecuteResult FromError(InteractionCommandError commandError, string reason) => new ExecuteResult(null, commandError, reason);