fix somes.

- command renamed "!노래추가" to "!신청곡", and its debugged.
- command "!노래시작" to user.discordId is null, send announce to chzzk chat.
- songlist function isDisabled value added.
This commit is contained in:
dalbodeule
2024-08-10 21:50:58 +09:00
parent ac7f9b3ad0
commit dd628738f7
5 changed files with 35 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ object SongConfigs: IntIdTable("song_config") {
val streamerOnly = bool("streamer_only").default(false)
val queueLimit = integer("queue_limit").default(50)
val personalLimit = integer("personal_limit").default(5)
val disabled = bool("disabled").default(false)
}
class SongConfig(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<SongConfig>(SongConfigs)
@@ -21,4 +22,5 @@ class SongConfig(id: EntityID<Int>) : IntEntity(id) {
var streamerOnly by SongConfigs.streamerOnly
var queueLimit by SongConfigs.queueLimit
var personalLimit by SongConfigs.personalLimit
var disabled by SongConfigs.disabled
}

View File

@@ -58,4 +58,16 @@ object SongConfigService {
songConfig
}
}
fun updateDisabled(user: User, config: Boolean): SongConfig {
return transaction {
var songConfig = SongConfig.find(SongConfigs.user eq user.id).firstOrNull()
if (songConfig == null) {
songConfig = initConfig(user)
}
songConfig.disabled = config
songConfig
}
}
}