mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
chzzk followdate error handler add
This commit is contained in:
parent
c35b3082cc
commit
7522ec6f9e
@ -143,7 +143,9 @@ class MessageHandler(
|
||||
}
|
||||
|
||||
result = followPattern.replace(result) {
|
||||
try {
|
||||
val following = getFollowDate(listener.chatId, msg.userId)
|
||||
|
||||
val dateString: String = following.content.streamingProperty.following?.followDate ?: SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(
|
||||
Date()
|
||||
)
|
||||
@ -155,6 +157,10 @@ class MessageHandler(
|
||||
|
||||
val period = Period.between(pastDate, today)
|
||||
period.days.toString()
|
||||
} catch (e: Exception) {
|
||||
logger.info(e.message)
|
||||
return@replace "0"
|
||||
}
|
||||
}
|
||||
|
||||
result = counterPattern.replace(result) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user