forked from DiscordBots/lilJudd
feat: Bot now skips Bot Users
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
3d1f2c7d8f
commit
8a77b275dc
1 changed files with 8 additions and 4 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
package net.moonleay.lilJudd.features
|
||||
|
||||
import com.kotlindiscord.kord.extensions.utils.isNullOrBot
|
||||
import dev.inmo.krontab.buildSchedule
|
||||
import dev.inmo.krontab.doInfinity
|
||||
import dev.kord.common.Color
|
||||
|
@ -162,12 +163,15 @@ object AvailabilityManager : IFeature {
|
|||
}
|
||||
mce.collect { memberchunkevent ->
|
||||
memberchunkevent.members.forEach {
|
||||
if (!it.isNullOrBot()) { // Check if the member is a bot
|
||||
Logger.out("Checking member ${it.id.value} (${it.username})")
|
||||
if (it.roleIds.contains(Snowflake(pnrd.hastimeroleid))) {
|
||||
it.removeRole(Snowflake(pnrd.hastimeroleid))
|
||||
Logger.out("Removed role from ${it.username}") // Removed the role
|
||||
}
|
||||
}
|
||||
// I cant use continue here, because it does not work with .forEach
|
||||
}
|
||||
}
|
||||
|
||||
Logger.out("Got through all members")
|
||||
|
|
Loading…
Reference in a new issue