2024-07-03 00:10:02 +01:00
|
|
|
package cc.fascinated.bat.features.reminder;
|
|
|
|
|
2024-07-04 03:52:33 +01:00
|
|
|
import cc.fascinated.bat.common.ChannelUtils;
|
2024-07-03 00:10:02 +01:00
|
|
|
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() {
|
2024-07-04 03:52:33 +01:00
|
|
|
return ChannelUtils.getTextChannel(channelId);
|
2024-07-03 00:10:02 +01:00
|
|
|
}
|
|
|
|
}
|