Skip to content

Commit

Permalink
[OneBot] Update Password when password enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Nov 21, 2023
1 parent 970791f commit 79ee878
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lagrange.OneBot/LagrangeApp.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Text;
using System.Text.Json;
using Lagrange.Core;
using Lagrange.Core.Common.Interface.Api;
using Lagrange.Core.Utility.Extension;
using Lagrange.Core.Utility.Sign;
using Lagrange.OneBot.Core.Message;
using Lagrange.OneBot.Core.Network;
Expand Down Expand Up @@ -48,7 +50,9 @@ internal LagrangeApp(IHost host)
Logger.LogInformation($"Protocol: {Configuration["Protocol"]} | {Instance.ContextCollection.AppInfo.CurrentVersion}");

Instance.ContextCollection.Packet.SignProvider = Services.GetRequiredService<SignProvider>();

if (!string.IsNullOrEmpty(Configuration["Account:Password"]))
Instance.ContextCollection.Keystore.PasswordMd5 = Encoding.UTF8.GetBytes(Configuration["Account:Password"] ?? "").Hex() ;

Instance.Invoker.OnBotLogEvent += (_, args) => Logger.Log(args.Level switch
{
LogLevel.Debug => Microsoft.Extensions.Logging.LogLevel.Trace,
Expand Down

0 comments on commit 79ee878

Please sign in to comment.