fix: Added user to WakeupJob fail msg

This commit is contained in:
moonleay 2023-12-08 11:35:06 +01:00
parent aab31d8d41
commit 338d00c990
Signed by: moonleay
GPG key ID: 82667543CCD715FB

View file

@ -47,6 +47,7 @@ class WakeupJob(override val jobName: String, override val jobIncoming: String,
val user = UserRepository.getUserByID(userId)
if (!user.isAwake){
// Failed
val userasuser = Bot.bot.kordRef.getUser(Snowflake(userId))!!.asUser()
val brokenStreak = user.currentStreak
val isBiggestStreakYet = user.currentStreak > user.longestStreak
++user.numberOfFails
@ -61,11 +62,11 @@ class WakeupJob(override val jobName: String, override val jobIncoming: String,
MessageUtil.getEmbed(
EmbedColor.ERROR,
"You failed to wake up!",
"You failed to wake up at ${TimeUtil.getHourAndMinuteFromStamp(user.nextWakeup)}!\n" +
"You lost a streak of ${user.currentStreak}" +
"${userasuser.mention} failed to wake up at ${TimeUtil.getHourAndMinuteFromStamp(user.nextWakeup)}!\n" +
"You lost a streak of $brokenStreak" +
if(isBiggestStreakYet) ", which was your biggest streak yet." else "." +
"\nYou can try again tomorrow with `/time`",
user.userid.toString(),
"Automated Message",
)
)
}