forked from DiscordBots/lilJudd
fix: fixed AvailabilityManager
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
6ab6aa1279
commit
4f3c76910c
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue