Liam cdd953351a
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 40s
add emoji logs and fix log channels that are set from vanishing
2024-07-04 05:10:35 +01:00

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);
}
}