fix: "you failed" response now only shows up, up to 12 hrs after fail

This commit is contained in:
moonleay 2023-12-08 11:53:47 +01:00
parent e4102cc56b
commit e996eebd1f
Signed by: moonleay
GPG key ID: 82667543CCD715FB

View file

@ -42,8 +42,7 @@ class AwakeExtension : Extension() {
val ud = UserRepository.getUserByID(u.id.value) val ud = UserRepository.getUserByID(u.id.value)
if (ud.isAwake) { if (ud.isAwake) {
// User is already awake // User is already awake
if (ud.currentStreak == 0 && ud.lastWakeup + (1000*60*60*12) > System.currentTimeMillis()) {
if (ud.currentStreak == 0) {
// User failed last time // User failed last time
this.respond { this.respond {
this.embeds.add( this.embeds.add(
@ -63,7 +62,8 @@ class AwakeExtension : Extension() {
MessageUtil.getEmbed( MessageUtil.getEmbed(
EmbedColor.ERROR, EmbedColor.ERROR,
"You are already awake!", "You are already awake!",
"You can set a wakeup time for tomorrow with `/time`", "There is nothing to change. You are already awake\n" +
"You can set a wakeup time for tomorrow with `/time`",
u.username, u.username,
) )
) )