-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'Auto-invite Moderator Role' option (#382)
* Add 'Auto-invite Moderator Role' option * Fix v7 migration * Fix compilation
- Loading branch information
1 parent
c499974
commit 631e8e2
Showing
6 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/org/hyacinthbots/lilybot/database/migrations/config/configV7.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.hyacinthbots.lilybot.database.migrations.config | ||
|
||
import org.hyacinthbots.lilybot.database.entities.ModerationConfigData | ||
import org.litote.kmongo.coroutine.CoroutineDatabase | ||
import org.litote.kmongo.exists | ||
import org.litote.kmongo.setValue | ||
|
||
suspend fun configV7(db: CoroutineDatabase) { | ||
with(db.getCollection<ModerationConfigData>("moderationConfigData")) { | ||
updateMany( | ||
ModerationConfigData::autoInviteModeratorRole exists false, | ||
setValue(ModerationConfigData::autoInviteModeratorRole, null) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters