Skip to content

Commit

Permalink
fix: save login credential after LoginByQrCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Deliay committed Apr 25, 2024
1 parent 32f5337 commit e52cb02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mikibot.Analyze/MiraiHttp/LagrangeBotBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,14 @@ public async ValueTask Run()

logger.LogInformation("需要扫码登录,二维码图片[png]:base64={}", Convert.ToBase64String(result.Value.QrCode));
await bot.LoginByQrCode();
await SaveKeyStore(bot.UpdateKeystore());
}

bot.Invoker.OnGroupMessageReceived += InvokerOnOnGroupMessageReceived;

logger.LogInformation("等待登录中...");
await WaitBotOnlineAsync();
logger.LogInformation("登录完成");

await SaveKeyStore(bot.UpdateKeystore());
}

private static IEnumerable<MessageBase> ConvertMessageToMiraiCore(MessageChain lagrange)
Expand Down Expand Up @@ -249,6 +248,7 @@ public async ValueTask SendMessageToSliceManGroup(CancellationToken token, param
private readonly Dictionary<Action<GroupMessageReceiver>, CancellationTokenRegistration> _subscriber = [];
public void SubscribeMessage(Action<GroupMessageReceiver> next, CancellationToken token)
{
logger.LogInformation("注册消费消息: {}", next);
_subscriber.Add(next, token.Register(() =>
{
_subscriber.TryGetValue(next, out var reg);
Expand Down

0 comments on commit e52cb02

Please sign in to comment.