diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 054f55c5d..d2a519511 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -447,6 +447,8 @@ namespace ArchiSteamFarm { return await ResponsePause(steamID, false).ConfigureAwait(false); case "!RESTART": return ResponseRestart(steamID); + case "!STARTALL": + return await ResponseStartAll(steamID).ConfigureAwait(false); case "!STATUS": return ResponseStatus(steamID); case "!STATUSALL": @@ -1249,6 +1251,20 @@ namespace ArchiSteamFarm { return "Done!"; } + private static async Task ResponseStartAll(ulong steamID) { + if (steamID == 0) { + Logging.LogNullError(nameof(steamID)); + return null; + } + + if (!IsOwner(steamID)) { + return null; + } + + await Task.WhenAll(Bots.Where(bot => !bot.Value.KeepRunning).Select(bot => bot.Value.ResponseStart(steamID))).ConfigureAwait(false); + return "Done!"; + } + private async Task ResponseAddLicense(ulong steamID, ICollection gameIDs) { if ((steamID == 0) || (gameIDs == null) || (gameIDs.Count == 0)) { Logging.LogNullError(nameof(steamID) + " || " + nameof(gameIDs) + " || " + nameof(gameIDs.Count), BotName);