Include more helpful output for Play() Bot action

This commit is contained in:
Archi
2021-06-21 23:38:02 +02:00
parent 6a8e48fd38
commit db3d4e465d
2 changed files with 3 additions and 3 deletions

View File

@@ -221,7 +221,7 @@ namespace ArchiSteamFarm.Steam.Interaction {
}
[PublicAPI]
public async Task<(bool Success, string Message)> Play(IEnumerable<uint> gameIDs, string? gameName = null) {
public async Task<(bool Success, string Message)> Play(IReadOnlyCollection<uint> gameIDs, string? gameName = null) {
if (gameIDs == null) {
throw new ArgumentNullException(nameof(gameIDs));
}
@@ -236,7 +236,7 @@ namespace ArchiSteamFarm.Steam.Interaction {
await Bot.ArchiHandler.PlayGames(gameIDs, gameName).ConfigureAwait(false);
return (true, Strings.Done);
return (true, gameIDs.Count > 0 ? string.Format(CultureInfo.CurrentCulture, Strings.BotIdlingSelectedGames, nameof(gameIDs), string.Join(", ", gameIDs)) : Strings.Done);
}
[PublicAPI]

View File

@@ -2888,7 +2888,7 @@ namespace ArchiSteamFarm.Steam.Interaction {
return FormatBotResponse(Strings.BotNotConnected);
}
(bool success, string message) = await Bot.Actions.Play(Enumerable.Empty<uint>(), Bot.BotConfig.CustomGamePlayedWhileIdle).ConfigureAwait(false);
(bool success, string message) = await Bot.Actions.Play(Array.Empty<uint>(), Bot.BotConfig.CustomGamePlayedWhileIdle).ConfigureAwait(false);
return FormatBotResponse(success ? message : string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, message));
}