added configurable warning and success reactions

changed that channels dont actually get deleted, but rather with a deleted flag, so the foreign keys are valid
added more optionals to server/channel/message/member retrieval
added throwing exceptions instead of just returning null
fixed filtering of deleted channels while the bot was offline
fixed channel listener
added message deleted listener structure
moved quartz properties to general application properties, because they were not found in the separate one
added try catch to reminderJob, so that the job is not in an invalid state
we now completely remove the starboard post, in case it falls under the threshold
added code to 'ignore' a staroard post form further stars, in case the post in the starboard gets deleted
now actually setting the reminded flag on a reminder
added handnling in case the channel to remind in does not exist anymore
This commit is contained in:
Sheldan
2020-04-01 23:46:28 +02:00
parent 089862bf15
commit c9557fccc2
45 changed files with 409 additions and 181 deletions

View File

@@ -52,7 +52,7 @@ public class StarboardPost {
private Instant starredDate;
@Column
private boolean deleted;
private boolean ignored;
public int getReactionCount() {
if(this.reactions == null) {

View File

@@ -8,4 +8,5 @@ import java.time.Instant;
public interface ReminderManagementService {
Reminder createReminder(AServerAChannelAUser userToBeReminded, String text, Instant timeToBeRemindedAt, Long messageId);
Reminder loadReminder(Long reminderId);
void setReminded(Reminder reminder);
}

View File

@@ -15,4 +15,8 @@ public interface StarboardPostManagementService {
List<StarboardPost> retrieveAllPosts(Long serverId);
Integer getPostCount(Long serverId);
Optional<StarboardPost> findByMessageId(Long messageId);
Optional<StarboardPost> findByStarboardPostId(Long postId);
void setStarboardPostIgnored(Long starboardPostId, Boolean newValue);
boolean isStarboardPost(Long starboardPostId);
void removePost(StarboardPost starboardPost);
}