48 lines
1.0 KiB
Java
48 lines
1.0 KiB
Java
|
package cc.fascinated.bat.features.reminder;
|
||
|
|
||
|
import cc.fascinated.bat.service.DiscordService;
|
||
|
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 DiscordService.JDA.getTextChannelById(channelId);
|
||
|
}
|
||
|
}
|