- "!노래추가" command append limits.
This commit is contained in:
dalbodeule 2024-08-05 21:16:41 +09:00
parent c5f8ce7528
commit debbd61aa7
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

View File

@ -211,9 +211,25 @@ class MessageHandler(
return return
} }
val config = SongConfigService.getConfig(user)
if(config.streamerOnly && msg.profile?.userRoleCode == "common_user") {
listener.sendChat("매니저만 이 명령어를 사용할 수 있습니다.")
return
}
val url = parts[1] val url = parts[1]
val songs = SongListService.getSong(user) val songs = SongListService.getSong(user)
if(songs.size >= config.queueLimit) {
listener.sendChat("더이상 노래를 신청할 수 없습니다. 잠시 뒤 다시 시도해주세요!")
return
}
if(songs.filter { it.uid == msg.userId }.size >= config.personalLimit) {
listener.sendChat("더이상 노래를 신청할 수 없습니다. 잠시 뒤 다시 시도해주세요!")
return
}
val video = getYoutubeVideo(url) val video = getYoutubeVideo(url)
if (video == null) { if (video == null) {
listener.sendChat("유튜브에서 찾을 수 없어요!") listener.sendChat("유튜브에서 찾을 수 없어요!")