This commit is contained in:
Łukasz Domeradzki
2025-05-02 12:56:54 +02:00
parent af6f9466a8
commit f62da0e273
5 changed files with 163 additions and 158 deletions

View File

@@ -22,7 +22,6 @@
// limitations under the License.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Composition;
using System.Diagnostics.CodeAnalysis;
@@ -39,7 +38,7 @@ namespace ArchiSteamFarm.OfficialPlugins.MobileAuthenticator;
[Export(typeof(IPlugin))]
[SuppressMessage("ReSharper", "MemberCanBeFileLocal")]
internal sealed class MobileAuthenticatorPlugin : OfficialPlugin, IBotCommand2, IBotSteamClient {
internal sealed class MobileAuthenticatorPlugin : OfficialPlugin, IBotCommand2 {
[JsonInclude]
public override string Name => nameof(MobileAuthenticatorPlugin);
@@ -66,25 +65,6 @@ internal sealed class MobileAuthenticatorPlugin : OfficialPlugin, IBotCommand2,
return await Commands.OnBotCommand(bot, access, message, args, steamID).ConfigureAwait(false);
}
public Task OnBotSteamCallbacksInit(Bot bot, CallbackManager callbackManager) {
ArgumentNullException.ThrowIfNull(bot);
ArgumentNullException.ThrowIfNull(callbackManager);
return Task.CompletedTask;
}
public Task<IReadOnlyCollection<ClientMsgHandler>?> OnBotSteamHandlersInit(Bot bot) {
ArgumentNullException.ThrowIfNull(bot);
SteamUnifiedMessages? steamUnifiedMessages = bot.GetHandler<SteamUnifiedMessages>();
if (steamUnifiedMessages == null) {
throw new InvalidOperationException(nameof(steamUnifiedMessages));
}
return Task.FromResult<IReadOnlyCollection<ClientMsgHandler>?>(new HashSet<ClientMsgHandler>(1) { new MobileAuthenticatorHandler(bot.ArchiLogger, steamUnifiedMessages) });
}
public override Task OnLoaded() {
Utilities.WarnAboutIncompleteTranslation(Strings.ResourceManager);