Skip to content

Commit

Permalink
Remove same user check from the drop module
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Oct 30, 2024
1 parent f180206 commit b15f1be
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class DropPointsStuffModule(val m: LorittaBot) : MessageReceivedModule {
.asMap()
private val lastDropsAt = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build<Long, Long>()
.asMap()
private val lastDropsByUserAt = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build<Long, Long>()
.asMap()

override suspend fun matches(event: LorittaMessageEvent, lorittaUser: LorittaUser, lorittaProfile: Profile?, serverConfig: ServerConfig, locale: BaseLocale, i18nContext: I18nContext): Boolean {
val guild = event.guild ?: return false
Expand Down Expand Up @@ -79,11 +77,6 @@ class DropPointsStuffModule(val m: LorittaBot) : MessageReceivedModule {
if (1_000 >= lastDropDiff)
return false

val userDropTime = lastDropsByUserAt.getOrDefault(event.author.idLong, 0L)

if (10_000 >= date - userDropTime)
return false

for (reactionSet in activeEvent.reactionSets) {
val randomNumber = LorittaBot.RANDOM.nextFloat()

Expand All @@ -96,7 +89,6 @@ class DropPointsStuffModule(val m: LorittaBot) : MessageReceivedModule {

if (spawnTheCandy) {
lastDropsAt[id] = date
lastDropsByUserAt[event.author.idLong] = date

// TODO: Fix this
// val type = LorittaEaster2023Event.easterEggColors.random()
Expand Down

0 comments on commit b15f1be

Please sign in to comment.