Skip to content

Commit

Permalink
Fixed DeviceInfo Generation for Lagrange.OneBot
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Oct 14, 2023
1 parent bfd93a8 commit 64a0c41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lagrange.OneBot/LagrangeAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public LagrangeAppBuilder ConfigureBots()
BotDeviceInfo deviceInfo;
if (!File.Exists(deviceInfoPath))
{
deviceInfo = new BotDeviceInfo();
deviceInfo = BotDeviceInfo.GenerateInfo();
string json = JsonSerializer.Serialize(deviceInfo);
File.WriteAllText(deviceInfoPath, json);
}
else
{
deviceInfo = JsonSerializer.Deserialize<BotDeviceInfo>(File.ReadAllText(deviceInfoPath)) ?? new BotDeviceInfo();
deviceInfo = JsonSerializer.Deserialize<BotDeviceInfo>(File.ReadAllText(deviceInfoPath)) ?? BotDeviceInfo.GenerateInfo();
}

Services.AddSingleton(BotFactory.Create(config, deviceInfo, keystore));
Expand Down

0 comments on commit 64a0c41

Please sign in to comment.