Skip to content

Commit

Permalink
[OneBot] Start the ILagrangeWebService when the Bot is online
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Nov 11, 2023
1 parent 0ad7633 commit 99509d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Lagrange.OneBot/LagrangeApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ internal LagrangeApp(IHost host)
Logger.LogInformation($"Bot Online: {keystore.Uin}");
string json = JsonSerializer.Serialize(keystore, new JsonSerializerOptions { WriteIndented = true });

// Adapters should be started here instead of at the start of application
await WebService.StartAsync(cancellationToken);

await File.WriteAllTextAsync(Configuration["ConfigPath:Keystore"] ?? "keystore.json", json, cancellationToken);
};

await WebService.StartAsync(cancellationToken);

if (string.IsNullOrEmpty(Configuration["Account:Password"]) &&
Instance.ContextCollection.Keystore.Session.TempPassword == null) // EasyLogin and PasswordLogin is both disabled
{
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Please use Lagrange.Core responsibly and in accordance with the law.
| [Music] | 🔴 |
| [Reply] | 🔴 |
| [Forward] | 🟢 |
| [Node] | 🔴 |
| [Node] | 🟢 |
| [Xml] | 🔴 |
| [Json] | 🔴 |

Expand Down Expand Up @@ -234,7 +234,7 @@ Please use Lagrange.Core responsibly and in accordance with the law.
| CommunicationType | Support |
| ------------------ | :-----: |
| [Http] | 🔴 |
| [Http-Post] | 🟢 |
| [Http-Post] | 🔴 |
| [ForwardWebSocket] | 🟢 |
| [ReverseWebSocket] | 🟢 |

Expand Down

0 comments on commit 99509d9

Please sign in to comment.