mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 05:39:44 +00:00
[AB-82] adding instant for cooldown exception model
removing not needed models for payday and slots cooldown exceptions
This commit is contained in:
@@ -5,12 +5,15 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class CoolDownCheckResult {
|
||||
private Duration executeIn;
|
||||
private Instant executeAt;
|
||||
private Boolean canExecute;
|
||||
private CoolDownReason reason;
|
||||
|
||||
@@ -20,6 +23,7 @@ public class CoolDownCheckResult {
|
||||
.canExecute(false)
|
||||
.reason(CoolDownReason.SERVER)
|
||||
.executeIn(duration)
|
||||
.executeAt(Instant.now().plus(duration.toSeconds(), ChronoUnit.SECONDS))
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -28,6 +32,7 @@ public class CoolDownCheckResult {
|
||||
.builder()
|
||||
.canExecute(false)
|
||||
.reason(CoolDownReason.CHANNEL_GROUP)
|
||||
.executeAt(Instant.now().plus(duration.toSeconds(), ChronoUnit.SECONDS))
|
||||
.executeIn(duration)
|
||||
.build();
|
||||
}
|
||||
@@ -37,6 +42,7 @@ public class CoolDownCheckResult {
|
||||
.builder()
|
||||
.canExecute(false)
|
||||
.reason(CoolDownReason.MEMBER)
|
||||
.executeAt(Instant.now().plus(duration.toSeconds(), ChronoUnit.SECONDS))
|
||||
.executeIn(duration)
|
||||
.build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user