add botIsDisabled, welcomeMessageDisabled.

This commit is contained in:
dalbodeule
2024-12-09 14:47:41 +09:00
parent 4fca9df9c2
commit eccf1a29bc
6 changed files with 93 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
package space.mori.chzzk_bot.common.events
data class BotEnabledEvent(
val chzzkId: String,
val isDisabled: Boolean,
): Event {
val TAG = javaClass.simpleName
}

View File

@@ -15,6 +15,7 @@ object Users: IntIdTable("users") {
val liveAlertChannel = long("live_alert_channel").nullable()
val liveAlertMessage = text("live_alert_message").nullable()
val isDisableStartupMsg = bool("is_disable_startup_msg").default(false)
val isDisabled = bool("is_disabled").default(false)
}
class User(id: EntityID<Int>) : IntEntity(id) {
@@ -28,6 +29,7 @@ class User(id: EntityID<Int>) : IntEntity(id) {
var liveAlertChannel by Users.liveAlertChannel
var liveAlertMessage by Users.liveAlertMessage
var isDisableStartupMsg by Users.isDisableStartupMsg
var isDisabled by Users.isDisabled
// 유저가 가진 매니저들
var managers by User.via(UserManagers.user, UserManagers.manager)

View File

@@ -89,4 +89,20 @@ object UserService {
user
}
}
fun setIsDisabled(user: User, disabled: Boolean): User {
return transaction {
user.isDisabled = disabled
user
}
}
fun setIsStartupDisabled(user: User, disabled: Boolean): User {
return transaction {
user.isDisableStartupMsg = disabled
user
}
}
}