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
|
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,11 +163,14 @@ object AvailabilityManager : IFeature {
|
||||||
}
|
}
|
||||||
mce.collect { memberchunkevent ->
|
mce.collect { memberchunkevent ->
|
||||||
memberchunkevent.members.forEach {
|
memberchunkevent.members.forEach {
|
||||||
Logger.out("Checking member ${it.id.value} (${it.username})")
|
if (!it.isNullOrBot()) { // Check if the member is a bot
|
||||||
if (it.roleIds.contains(Snowflake(pnrd.hastimeroleid))) {
|
Logger.out("Checking member ${it.id.value} (${it.username})")
|
||||||
it.removeRole(Snowflake(pnrd.hastimeroleid))
|
if (it.roleIds.contains(Snowflake(pnrd.hastimeroleid))) {
|
||||||
Logger.out("Removed role from ${it.username}") // Removed the role
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue