Skip to content

Commit

Permalink
Add migration + exemption to mod timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
sschr15 committed Nov 19, 2023
1 parent 67445a6 commit 872cbfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,18 @@ object AllMigrations {

db.createCollection(PingGroupCollection.name)
}

suspend fun v27(db: CoroutineDatabase) {
with(db.getCollection<ServerSettings>(ServerSettingsCollection.name)) {
updateMany(
ServerSettings::exemptUsers exists false,
setValue(ServerSettings::exemptUsers, mutableSetOf())
)

updateMany(
ServerSettings::exemptRoles exists false,
setValue(ServerSettings::exemptRoles, mutableSetOf())
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class ModerationExtension(
event<MessageCreateEvent> {
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) {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 872cbfc

Please sign in to comment.