Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
feat(fx)!: rename IgnoreWhenCallingUndefinedCommand property to `Ig…
Browse files Browse the repository at this point in the history
…noreUndefinedCommand` in `FlandreAppOptions`
  • Loading branch information
bsdayo committed Jun 13, 2023
1 parent 7677efe commit a1cb3b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Flandre.Framework/Common/MiddlewareContext.cs
Expand Up @@ -37,6 +37,9 @@ public sealed class MiddlewareContext : MessageContext
/// </summary>
public Exception? Exception { get; internal set; }

// TODO: 添加 IsFailed 和 FailReason 属性
// TODO: enum MiddlewareFailReason { None, Exception, MissingArgument, ... }

private IDictionary<string, object?>? _properties;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Flandre.Framework/FlandreAppOptions.cs
Expand Up @@ -13,5 +13,5 @@ public sealed class FlandreAppOptions
/// <summary>
/// 在用户调用指令时,不进行“指令未找到”提示
/// </summary>
public bool IgnoreWhenCallingUndefinedCommand { get; set; } = false;
public bool IgnoreUndefinedCommand { get; set; } = false;
}
2 changes: 1 addition & 1 deletion src/Flandre.Framework/InternalMiddlewares.cs
Expand Up @@ -183,7 +183,7 @@ public FlandreApp UseCommandParser()
return node.Command;

if (!string.IsNullOrWhiteSpace(commandPrefix) &&
!_appOptions.CurrentValue.IgnoreWhenCallingUndefinedCommand)
!_appOptions.CurrentValue.IgnoreUndefinedCommand)
ctx.Response = $"未找到指令:{string.Join('.', path)}";
return null;
}
Expand Down

0 comments on commit a1cb3b2

Please sign in to comment.