diff --git a/src/main/kotlin/org/quiltmc/community/database/migrations/AllMigrations.kt b/src/main/kotlin/org/quiltmc/community/database/migrations/AllMigrations.kt index 9c2f611d..48669817 100644 --- a/src/main/kotlin/org/quiltmc/community/database/migrations/AllMigrations.kt +++ b/src/main/kotlin/org/quiltmc/community/database/migrations/AllMigrations.kt @@ -321,4 +321,18 @@ object AllMigrations { db.createCollection(PingGroupCollection.name) } + + suspend fun v27(db: CoroutineDatabase) { + with(db.getCollection(ServerSettingsCollection.name)) { + updateMany( + ServerSettings::exemptUsers exists false, + setValue(ServerSettings::exemptUsers, mutableSetOf()) + ) + + updateMany( + ServerSettings::exemptRoles exists false, + setValue(ServerSettings::exemptRoles, mutableSetOf()) + ) + } + } } diff --git a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/moderation/ModerationExtension.kt b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/moderation/ModerationExtension.kt index 42d803cb..92cfc0a4 100644 --- a/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/moderation/ModerationExtension.kt +++ b/src/main/kotlin/org/quiltmc/community/modes/quilt/extensions/moderation/ModerationExtension.kt @@ -157,6 +157,7 @@ class ModerationExtension( event { check { isNotBot() } // oh man my bot is going crazy check { notHasBaseModeratorRole() } // mods can spam :pineapple: + check { notExempted() } action { if (event.member?.roles?.firstOrNull { it.id in MODERATOR_ROLES } != null) { @@ -228,6 +229,7 @@ class ModerationExtension( check { failIf(event.message.author?.isBot == true) } check { failIf(event.guildId == null) } check { notHasBaseModeratorRole() } + check { notExempted() } check { failIf( event.getGuildOrNull()