mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-08-07 21:01:14 +00:00
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:
@@ -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
|
||||
}
|
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user