diff --git a/src/NadekoBot/Bot.cs b/src/NadekoBot/Bot.cs index 299c01cb3..d00aa211c 100644 --- a/src/NadekoBot/Bot.cs +++ b/src/NadekoBot/Bot.cs @@ -119,8 +119,6 @@ public sealed class Bot // admin #if GLOBAL_NADEKO svcs.AddSingleton(); -#else - svcs.AddSingleton(); #endif svcs.AddHttpClient(); diff --git a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs index 31a3be8de..1ca000b87 100644 --- a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs +++ b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs @@ -8,6 +8,9 @@ using NadekoBot.Services.Database.Models; namespace NadekoBot.Modules.Administration; public sealed class LogCommandService : ILogCommandService, IReadyExecutor + #if !GLOBAL_NADEKO + , INService // don't load this service on global nadeko + #endif { public ConcurrentDictionary GuildLogSettings { get; } @@ -42,9 +45,6 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor _mute = mute; _prot = prot; _tz = tz; - -#if !GLOBAL_NADEKO - using (var uow = db.GetDbContext()) { var guildIds = client.Guilds.Select(x => x.Id).ToList(); @@ -64,7 +64,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor _client.UserUnbanned += _client_UserUnbanned; _client.UserJoined += _client_UserJoined; _client.UserLeft += _client_UserLeft; - //_client.UserPresenceUpdated += _client_UserPresenceUpdated; + // _client.PresenceUpdated += _client_UserPresenceUpdated; _client.UserVoiceStateUpdated += _client_UserVoiceStateUpdated; _client.UserVoiceStateUpdated += _client_UserVoiceStateUpdated_TTS; _client.GuildMemberUpdated += _client_GuildUserUpdated; @@ -78,12 +78,10 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor _mute.UserUnmuted += MuteCommands_UserUnmuted; _prot.OnAntiProtectionTriggered += TriggeredAntiProtection; - -#endif } - public Task OnReadyAsync() - => Task.WhenAll(PresenceUpdateTask(), IgnoreMessageIdsClearTask()); + public async Task OnReadyAsync() + => await Task.WhenAll(PresenceUpdateTask(), IgnoreMessageIdsClearTask()); private async Task IgnoreMessageIdsClearTask() { @@ -94,7 +92,6 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor private async Task PresenceUpdateTask() { -#if !GLOBAL_NADEKO using var timer = new PeriodicTimer(TimeSpan.FromSeconds(15)); while (await timer.WaitForNextTickAsync()) { @@ -120,7 +117,6 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor } catch { } } -#endif } public LogSetting? GetGuildLogSettings(ulong guildId)