This commit is contained in:
Stanley Dimant
2025-01-03 02:16:45 +01:00
parent 98ed5cb472
commit 698890f991

View File

@@ -270,12 +270,16 @@ internal class DiscordBot : IHostedService
foreach (var user in userList) foreach (var user in userList)
{ {
if (registeredUsers.Contains(user.Id)) if (registeredUsers.Contains(user.Id))
await _botServices.AddRegisteredRoleAsync(user, registrationRole).ConfigureAwait(false);
if (kickUnregistered)
{ {
if ((executionStartTime - user.JoinedAt.Value).TotalDays > 7) await _botServices.AddRegisteredRoleAsync(user, registrationRole).ConfigureAwait(false);
await _botServices.KickUserAsync(user).ConfigureAwait(false); }
else
{
if (kickUnregistered)
{
if ((executionStartTime - user.JoinedAt.Value).TotalDays > 7)
await _botServices.KickUserAsync(user).ConfigureAwait(false);
}
} }
token.ThrowIfCancellationRequested(); token.ThrowIfCancellationRequested();