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