mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Add !startall
This commit is contained in:
@@ -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<string> 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<string> ResponseAddLicense(ulong steamID, ICollection<uint> gameIDs) {
|
||||
if ((steamID == 0) || (gameIDs == null) || (gameIDs.Count == 0)) {
|
||||
Logging.LogNullError(nameof(steamID) + " || " + nameof(gameIDs) + " || " + nameof(gameIDs.Count), BotName);
|
||||
|
||||
Reference in New Issue
Block a user