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

This commit is contained in:
Kwoth
2024-07-29 04:31:09 +00:00
parent 2fba771681
commit 762a2eca1f

View File

@@ -158,11 +158,18 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, INService
public async Task OnReadyAsync()
{
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,