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