Liam
cdd953351a
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 40s
48 lines
1023 B
Java
48 lines
1023 B
Java
package cc.fascinated.bat.features.reminder;
|
|
|
|
import cc.fascinated.bat.common.ChannelUtils;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Getter;
|
|
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
|
|
|
import java.util.Date;
|
|
|
|
/**
|
|
* @author Fascinated (fascinated7)
|
|
*/
|
|
@AllArgsConstructor @Getter
|
|
public class Reminder {
|
|
/**
|
|
* What we should remind the user of
|
|
*/
|
|
private final String reminder;
|
|
|
|
/**
|
|
* The channel ID to send the reminder to
|
|
*/
|
|
private final String channelId;
|
|
|
|
/**
|
|
* The date the reminder should end
|
|
*/
|
|
private final Date endDate;
|
|
|
|
/**
|
|
* Check if the reminder is expired
|
|
*
|
|
* @return If the reminder is expired
|
|
*/
|
|
public boolean isExpired() {
|
|
return System.currentTimeMillis() >= endDate.getTime();
|
|
}
|
|
|
|
/**
|
|
* Get the channel to send the reminder to
|
|
*
|
|
* @return The channel
|
|
*/
|
|
public TextChannel getChannel() {
|
|
return ChannelUtils.getTextChannel(channelId);
|
|
}
|
|
}
|