Skip to content

Commit

Permalink
[Test] fix test error (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkRRb authored Dec 26, 2024
1 parent a4903fe commit 1f84705
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Lagrange.Core.Test/Tests/NTLoginTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Lagrange.Core.Common;
using Lagrange.Core.Common.Interface;
using Lagrange.Core.Common.Interface.Api;
using Lagrange.Core.Internal.Event.System;
using Lagrange.Core.Message;

namespace Lagrange.Core.Test.Tests;

Expand All @@ -13,41 +13,41 @@ public async Task LoginByPassword()
{
var deviceInfo = WtLoginTest.GetDeviceInfo();
var keyStore = WtLoginTest.LoadKeystore();

if (keyStore == null)
{
Console.WriteLine("Please login by QrCode first");
return;
}

var bot = BotFactory.Create(new BotConfig()
var bot = BotFactory.Create(new BotConfig()
{
UseIPv6Network = false,
GetOptimumServer = true,
AutoReconnect = true,
Protocol = Protocols.Linux
}, deviceInfo, keyStore);

bot.Invoker.OnBotLogEvent += (_, @event) =>
{
Utility.Console.ChangeColorByTitle(@event.Level);
Console.WriteLine(@event.ToString());
};

bot.Invoker.OnBotOnlineEvent += (_, @event) =>
{
Console.WriteLine(@event.ToString());
WtLoginTest.SaveKeystore(bot.UpdateKeystore());
};

bot.Invoker.OnBotCaptchaEvent += (_, @event) =>
{
Console.WriteLine(@event.ToString());
var captcha = Console.ReadLine();
var randStr = Console.ReadLine();
if (captcha != null && randStr != null) bot.SubmitCaptcha(captcha, randStr);
};

bot.Invoker.OnGroupInvitationReceived += (_, @event) =>
{
Console.WriteLine(@event.ToString());
Expand Down

0 comments on commit 1f84705

Please sign in to comment.