Skip to content

Commit

Permalink
fix regression introduced in 1.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudokhvist committed Sep 8, 2024
1 parent 27233b0 commit 9563394
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CommandAliasPlugin/CommandAliasPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Task OnASFInit(IReadOnlyDictionary<string, JsonElement>? additionalConfig

foreach (string commandFormat in alias.Commands) {
try {
string command = string.Format(CultureInfo.CurrentCulture, commandFormat, [.. args[1..alias.ParamNumber], Utilities.GetArgsAsText(message, alias.ParamNumber)]);
string command = alias.ParamNumber > 0 ? string.Format(CultureInfo.CurrentCulture, commandFormat, [.. args[1..alias.ParamNumber], Utilities.GetArgsAsText(message, alias.ParamNumber)]) : commandFormat;
switch (command.Split(" ")[0].ToUpper(CultureInfo.CurrentCulture)) { //just in case of future increase of meta-commands
case "wait":
if (int.TryParse(command.Split(" ")?.ElementAt(1), out int waitmsec)) {
Expand All @@ -111,8 +111,8 @@ public Task OnASFInit(IReadOnlyDictionary<string, JsonElement>? additionalConfig
break;
}
} catch (Exception) {
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, "Aliase configuration"));
return string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, "Aliase configuration");
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, "Alias configuration"));
return string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, "Alias configuration");
}
}

Expand Down

0 comments on commit 9563394

Please sign in to comment.