implement wildcard lenght quantifiers, TreatAsRegex property and solve catastrpohic backtracking (#2528)
This commit is contained in:
@@ -35,6 +35,9 @@ namespace Discord.Interactions.Builders
|
||||
/// <inheritdoc/>
|
||||
public bool IgnoreGroupNames { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool TreatNameAsRegex { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public RunMode RunMode { get; set; }
|
||||
|
||||
@@ -117,6 +120,19 @@ namespace Discord.Interactions.Builders
|
||||
return Instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets <see cref="TreatNameAsRegex"/>.
|
||||
/// </summary>
|
||||
/// <param name="value">New value of the <see cref="TreatNameAsRegex"/>.</param>
|
||||
/// <returns>
|
||||
/// The builder instance.
|
||||
/// </returns>
|
||||
public TBuilder WithNameAsRegex (bool value)
|
||||
{
|
||||
TreatNameAsRegex = value;
|
||||
return Instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds parameter builders to <see cref="Parameters"/>.
|
||||
/// </summary>
|
||||
@@ -163,6 +179,10 @@ namespace Discord.Interactions.Builders
|
||||
ICommandBuilder ICommandBuilder.SetRunMode (RunMode runMode) =>
|
||||
SetRunMode(runMode);
|
||||
|
||||
/// <inheritdoc/>
|
||||
ICommandBuilder ICommandBuilder.WithNameAsRegex(bool value) =>
|
||||
WithNameAsRegex(value);
|
||||
|
||||
/// <inheritdoc/>
|
||||
ICommandBuilder ICommandBuilder.AddParameters (params IParameterBuilder[] parameters) =>
|
||||
AddParameters(parameters as TParamBuilder);
|
||||
|
||||
@@ -34,6 +34,11 @@ namespace Discord.Interactions.Builders
|
||||
/// </summary>
|
||||
bool IgnoreGroupNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the <see cref="Name"/> should be directly used as a Regex pattern.
|
||||
/// </summary>
|
||||
bool TreatNameAsRegex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the run mode this command gets executed with.
|
||||
/// </summary>
|
||||
@@ -90,6 +95,15 @@ namespace Discord.Interactions.Builders
|
||||
/// </returns>
|
||||
ICommandBuilder SetRunMode (RunMode runMode);
|
||||
|
||||
/// <summary>
|
||||
/// Sets <see cref="TreatNameAsRegex"/>.
|
||||
/// </summary>
|
||||
/// <param name="value">New value of the <see cref="TreatNameAsRegex"/>.</param>
|
||||
/// <returns>
|
||||
/// The builder instance.
|
||||
/// </returns>
|
||||
ICommandBuilder WithNameAsRegex(bool value);
|
||||
|
||||
/// <summary>
|
||||
/// Adds parameter builders to <see cref="Parameters"/>.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user