From 1df8f092fe92cf8cc95d84783adaa5a1a93db709 Mon Sep 17 00:00:00 2001 From: Toastie Date: Mon, 29 Jul 2024 18:57:59 +1200 Subject: [PATCH] .keep will also automatically trigger for any new server the bot joins --- .../Administration/DangerousCommands/CleanupService.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs index 92feac4..7bf7128 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs @@ -159,10 +159,17 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService { await _pubSub.Sub(_keepTriggerKey, OnKeepTrigger); + _client.JoinedGuild += ClientOnJoinedGuild; + if (_client.ShardId == 0) await _pubSub.Sub(_keepReportKey, OnKeepReport); } + private async Task ClientOnJoinedGuild(SocketGuild arg) + { + await KeepGuild(arg.Id); + } + private ValueTask OnKeepTrigger(bool arg) { _pubSub.Pub(_keepReportKey,