diff --git a/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt b/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt index c5b83c8..6b8f037 100644 --- a/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt +++ b/src/main/kotlin/net/perfectdreams/loritta/helper/utils/lorittaautomods/CheckDupeClientIds.kt @@ -67,13 +67,12 @@ class CheckDupeClientIds(val helper: LorittaHelper) : RunnableCoroutine { .toList() val usersToBeBanned = mutableListOf() - val alreadyChecked = mutableSetOf() for (clientIdThatAreBanned in clientIdsThatAreBanned) { - if (!alreadyChecked.contains(clientIdThatAreBanned[BannedUsers.userId])) { - val user = dailiesGotInLast24Hours.first { it[BrowserFingerprints.clientId] == clientIdThatAreBanned[BrowserFingerprints.clientId] } - // println("User ${user[Dailies.receivedById]} should be banned because ${clientIdThatAreBanned[BannedUsers.userId]} is banned") + val users = dailiesGotInLast24Hours.filter { it[BrowserFingerprints.clientId] == clientIdThatAreBanned[BrowserFingerprints.clientId] } + // println("User ${user[Dailies.receivedById]} should be banned because ${clientIdThatAreBanned[BannedUsers.userId]} is banned") + for (user in users) { usersToBeBanned.add( BannedUser( user[Dailies.receivedById], @@ -83,7 +82,6 @@ class CheckDupeClientIds(val helper: LorittaHelper) : RunnableCoroutine { user[Profiles.money] ) ) - alreadyChecked.add(clientIdThatAreBanned[BannedUsers.userId]) } }