mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Misc
This commit is contained in:
@@ -115,6 +115,23 @@ public sealed class Actions : IAsyncDisposable, IDisposable {
|
||||
return (success, token, success ? Strings.Success : Strings.WarningFailed);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public async Task<(bool Success, IReadOnlyCollection<Confirmation>? Confirmations, string Message)> GetConfirmations() {
|
||||
if (Bot.BotDatabase.MobileAuthenticator == null) {
|
||||
return (false, null, Strings.BotNoASFAuthenticator);
|
||||
}
|
||||
|
||||
if (!Bot.IsConnectedAndLoggedOn) {
|
||||
return (false, null, Strings.BotNotConnected);
|
||||
}
|
||||
|
||||
ImmutableHashSet<Confirmation>? confirmations = await Bot.BotDatabase.MobileAuthenticator.GetConfirmations().ConfigureAwait(false);
|
||||
|
||||
bool success = confirmations != null;
|
||||
|
||||
return (success, confirmations, success ? Strings.Success : Strings.WarningFailed);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public ulong GetFirstSteamMasterID() {
|
||||
ulong steamMasterID = Bot.BotConfig.SteamUserPermissions.Where(kv => (kv.Key > 0) && (kv.Key != Bot.SteamID) && new SteamID(kv.Key).IsIndividualAccount && (kv.Value == BotConfig.EAccess.Master)).Select(static kv => kv.Key).OrderBy(static steamID => steamID).FirstOrDefault();
|
||||
@@ -135,23 +152,6 @@ public sealed class Actions : IAsyncDisposable, IDisposable {
|
||||
return new SemaphoreLock(TradingSemaphore);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public async Task<(bool Success, IReadOnlyCollection<Confirmation>? Confirmations, string Message)> GetConfirmations() {
|
||||
if (Bot.BotDatabase.MobileAuthenticator == null) {
|
||||
return (false, null, Strings.BotNoASFAuthenticator);
|
||||
}
|
||||
|
||||
if (!Bot.IsConnectedAndLoggedOn) {
|
||||
return (false, null, Strings.BotNotConnected);
|
||||
}
|
||||
|
||||
ImmutableHashSet<Confirmation>? confirmations = await Bot.BotDatabase.MobileAuthenticator.GetConfirmations().ConfigureAwait(false);
|
||||
|
||||
bool success = confirmations != null;
|
||||
|
||||
return (success, confirmations, success ? Strings.Success : Strings.WarningFailed);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public async Task<(bool Success, IReadOnlyCollection<Confirmation>? HandledConfirmations, string Message)> HandleTwoFactorAuthenticationConfirmations(bool accept, Confirmation.EConfirmationType? acceptedType = null, IReadOnlyCollection<ulong>? acceptedCreatorIDs = null, bool waitIfNeeded = false) {
|
||||
if (Bot.BotDatabase.MobileAuthenticator == null) {
|
||||
|
||||
Reference in New Issue
Block a user