From 4f3c76910cba591c05561ba27eac03fe98579d5b Mon Sep 17 00:00:00 2001 From: moonleay Date: Wed, 6 Sep 2023 22:05:29 +0200 Subject: [PATCH] fix: fixed AvailabilityManager Signed-off-by: moonleay --- .../moonleay/lilJudd/features/AvailabilityManager.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt b/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt index 1359f50..2a980dc 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt @@ -96,8 +96,8 @@ object AvailabilityManager : IFeature { } val roleData = roleMap[data.channelid] // Get the role data if (roleData == null) { - Logger.out("Role for this channel does not exist") - return + Logger.out("Role for channel ${data.channelid} does not exist") + continue // this took way to long to find out that this was the issue } val g = Bot.bot.kordRef.getGuildOrThrow(Snowflake(data.serverid)) // Get all members with the role @@ -106,9 +106,11 @@ object AvailabilityManager : IFeature { } mce.collect { memberchunkevent -> memberchunkevent.members.forEach { - Logger.out("Checking member ${it.id.value}") - if (it.roleIds.contains(Snowflake(roleData.hastimeroleid))) + Logger.out("Checking member ${it.id.value} (${it.username})") + if (it.roleIds.contains(Snowflake(roleData.hastimeroleid))) { it.removeRole(Snowflake(roleData.hastimeroleid)) + Logger.out("Removed role from ${it.username}") // Removed the role + } } }