mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-15 01:17:37 +00:00
Add !startall
This commit is contained in:
parent
7683b98180
commit
f7e31a5754
1 changed files with 16 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue