mirror of
https://github.com/InsanusMokrassar/CaptchaPlaguBotPlugin.git
synced 2024-11-25 11:38:55 +00:00
fixes in captcha chats settings repo
This commit is contained in:
parent
418d6b7f45
commit
c84cff9ddc
@ -33,6 +33,7 @@ class CaptchaChatsSettingsRepo(
|
|||||||
private val autoRemoveCommandsColumn = bool("autoRemoveCommands")
|
private val autoRemoveCommandsColumn = bool("autoRemoveCommands")
|
||||||
private val autoRemoveEventsColumn = bool("autoRemoveEvents").apply { default(true) }
|
private val autoRemoveEventsColumn = bool("autoRemoveEvents").apply { default(true) }
|
||||||
private val enabledColumn = bool("enabled").default(true)
|
private val enabledColumn = bool("enabled").default(true)
|
||||||
|
private val kickOnUnsuccessColumn = bool("kick").default(true)
|
||||||
|
|
||||||
override val primaryKey = PrimaryKey(chatIdColumn)
|
override val primaryKey = PrimaryKey(chatIdColumn)
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ class CaptchaChatsSettingsRepo(
|
|||||||
it[autoRemoveCommandsColumn] = value.autoRemoveCommands
|
it[autoRemoveCommandsColumn] = value.autoRemoveCommands
|
||||||
it[autoRemoveEventsColumn] = value.autoRemoveEvents
|
it[autoRemoveEventsColumn] = value.autoRemoveEvents
|
||||||
it[enabledColumn] = value.enabled
|
it[enabledColumn] = value.enabled
|
||||||
|
it[kickOnUnsuccessColumn] = value.kickOnUnsuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun update(id: ChatId, value: ChatSettings, it: UpdateStatement) {
|
override fun update(id: ChatId, value: ChatSettings, it: UpdateStatement) {
|
||||||
@ -54,6 +56,7 @@ class CaptchaChatsSettingsRepo(
|
|||||||
it[autoRemoveCommandsColumn] = value.autoRemoveCommands
|
it[autoRemoveCommandsColumn] = value.autoRemoveCommands
|
||||||
it[autoRemoveEventsColumn] = value.autoRemoveEvents
|
it[autoRemoveEventsColumn] = value.autoRemoveEvents
|
||||||
it[enabledColumn] = value.enabled
|
it[enabledColumn] = value.enabled
|
||||||
|
it[kickOnUnsuccessColumn] = value.kickOnUnsuccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +65,8 @@ class CaptchaChatsSettingsRepo(
|
|||||||
captchaProvider = captchaProviderSerialFormat.decodeFromString(CaptchaProvider.serializer(), get(captchaProviderColumn)),
|
captchaProvider = captchaProviderSerialFormat.decodeFromString(CaptchaProvider.serializer(), get(captchaProviderColumn)),
|
||||||
autoRemoveCommands = get(autoRemoveCommandsColumn),
|
autoRemoveCommands = get(autoRemoveCommandsColumn),
|
||||||
autoRemoveEvents = get(autoRemoveEventsColumn),
|
autoRemoveEvents = get(autoRemoveEventsColumn),
|
||||||
enabled = get(enabledColumn)
|
enabled = get(enabledColumn),
|
||||||
|
kickOnUnsuccess = get(kickOnUnsuccessColumn)
|
||||||
)
|
)
|
||||||
|
|
||||||
override val selectById: SqlExpressionBuilder.(ChatId) -> Op<Boolean> = { chatIdColumn.eq(it.chatId) }
|
override val selectById: SqlExpressionBuilder.(ChatId) -> Op<Boolean> = { chatIdColumn.eq(it.chatId) }
|
||||||
@ -72,7 +76,8 @@ class CaptchaChatsSettingsRepo(
|
|||||||
captchaProvider = captchaProviderSerialFormat.decodeFromString(CaptchaProvider.serializer(), get(captchaProviderColumn)),
|
captchaProvider = captchaProviderSerialFormat.decodeFromString(CaptchaProvider.serializer(), get(captchaProviderColumn)),
|
||||||
autoRemoveCommands = get(autoRemoveCommandsColumn),
|
autoRemoveCommands = get(autoRemoveCommandsColumn),
|
||||||
autoRemoveEvents = get(autoRemoveEventsColumn),
|
autoRemoveEvents = get(autoRemoveEventsColumn),
|
||||||
enabled = get(enabledColumn)
|
enabled = get(enabledColumn),
|
||||||
|
kickOnUnsuccess = get(kickOnUnsuccessColumn)
|
||||||
)
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
Loading…
Reference in New Issue
Block a user