Skip to content

Commit

Permalink
[OneBot] Fixed NotifyService.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Dec 16, 2023
1 parent 06f5137 commit 15dbebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lagrange.OneBot/Core/Notify/NotifyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace Lagrange.OneBot.Core.Notify;

public sealed class NotifyService
public sealed class NotifyService(BotContext bot, ILogger<NotifyService> logger, LagrangeWebSvcCollection service)
{
public NotifyService(BotContext bot, ILogger<NotifyService> logger, LagrangeWebSvcCollection service)
public void RegisterEvents()
{
bot.Invoker.OnFriendRequestEvent += async (_, @event) =>
{
Expand Down
2 changes: 2 additions & 0 deletions Lagrange.OneBot/LagrangeApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Lagrange.Core.Utility.Sign;
using Lagrange.OneBot.Core.Message;
using Lagrange.OneBot.Core.Network;
using Lagrange.OneBot.Core.Notify;
using Lagrange.OneBot.Core.Operation;
using Lagrange.OneBot.Utility;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -71,6 +72,7 @@ public async Task StartAsync(CancellationToken cancellationToken = new())
// Adapters should be started here instead of at the start of application
await WebService.StartAsync(cancellationToken);
Services.GetRequiredService<NotifyService>().RegisterEvents();
await File.WriteAllTextAsync(Configuration["ConfigPath:Keystore"] ?? "keystore.json", json, cancellationToken);
};
Expand Down

0 comments on commit 15dbebb

Please sign in to comment.