mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
commit
4a754569cd
@ -16,7 +16,6 @@ import xyz.r2turntrue.chzzk4j.chat.ChzzkChat
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.temporal.ChronoUnit
|
||||
import java.util.UUID
|
||||
|
||||
|
||||
class MessageHandler(
|
||||
@ -246,6 +245,11 @@ class MessageHandler(
|
||||
return
|
||||
}
|
||||
|
||||
if (video.length > 600) {
|
||||
listener.sendChat("10분이 넘는 노래는 신청할 수 없습니다.")
|
||||
return
|
||||
}
|
||||
|
||||
SongListService.saveSong(
|
||||
user,
|
||||
msg.userId,
|
||||
@ -270,7 +274,7 @@ class MessageHandler(
|
||||
)
|
||||
}
|
||||
|
||||
listener.sendChat("노래가 추가되었습니다.")
|
||||
listener.sendChat("노래가 추가되었습니다. ${video.name} - ${video.author}")
|
||||
} catch(e: Exception) {
|
||||
listener.sendChat("유튜브 영상 주소로 다시 신청해주세요!")
|
||||
logger.info(e.stackTraceToString())
|
||||
|
@ -15,7 +15,7 @@ data class YoutubeVideo(
|
||||
val length: Int
|
||||
)
|
||||
|
||||
val regex = ".*(?:youtu.be/|v/|u/\\w/|embed/|watch\\?v=|&v=)([^#&?]*).*".toRegex()
|
||||
val regex = ".*(?:youtu.be/|v/|u/\\w/|embed/|watch\\?v=|&v=|music\\.youtube\\.com/.*?\\?v=)([^#&?]*).*".toRegex()
|
||||
val durationRegex = """PT(\d+H)?(\d+M)?(\d+S)?""".toRegex()
|
||||
|
||||
val dotenv = dotenv {
|
||||
|
Loading…
x
Reference in New Issue
Block a user