fix: Added user to WakeupJob fail msg
This commit is contained in:
parent
aab31d8d41
commit
338d00c990
1 changed files with 4 additions and 3 deletions
|
@ -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",
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue