.keep will also automatically trigger for any new server the bot joins

This commit is contained in:
Toastie (DCS Team) 2024-07-29 18:57:59 +12:00
parent e3a4c4bd43
commit 1df8f092fe
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4

View file

@ -159,10 +159,17 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService
{ {
await _pubSub.Sub(_keepTriggerKey, OnKeepTrigger); await _pubSub.Sub(_keepTriggerKey, OnKeepTrigger);
_client.JoinedGuild += ClientOnJoinedGuild;
if (_client.ShardId == 0) if (_client.ShardId == 0)
await _pubSub.Sub(_keepReportKey, OnKeepReport); await _pubSub.Sub(_keepReportKey, OnKeepReport);
} }
private async Task ClientOnJoinedGuild(SocketGuild arg)
{
await KeepGuild(arg.Id);
}
private ValueTask OnKeepTrigger(bool arg) private ValueTask OnKeepTrigger(bool arg)
{ {
_pubSub.Pub(_keepReportKey, _pubSub.Pub(_keepReportKey,