Skip to content

Commit

Permalink
Activate multiple definitions in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Sep 30, 2024
1 parent 55d49f8 commit b7a6cc5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ArchiSteamFarm/Steam/Interaction/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2784,12 +2784,14 @@ internal void OnNewLicenseList() {
return FormatBotResponse(Strings.BotNotConnected);
}

IList<EResult> results = await Utilities.InParallel(definitionIDs.Select(Bot.Actions.RedeemPoints)).ConfigureAwait(false);

int i = 0;

StringBuilder response = new();

foreach (uint definitionID in definitionIDs) {
EResult result = await Bot.Actions.RedeemPoints(definitionID).ConfigureAwait(false);

response.AppendLine(FormatBotResponse(Strings.FormatBotAddLicense(definitionID, result)));
response.AppendLine(FormatBotResponse(Strings.FormatBotAddLicense(definitionID, results[i++])));
}

return response.Length > 0 ? response.ToString() : null;
Expand Down

0 comments on commit b7a6cc5

Please sign in to comment.