[AB-85] adding feature mode to automatically create a thread for suggestions

reworking post target service to function with optionals
fixing trying to add reactions for suggestions if there was no message created
not showing votes in case the buttons feature mode is active
This commit is contained in:
Sheldan
2023-02-26 10:50:36 +01:00
parent 97895f5c56
commit 9d184ff560
8 changed files with 211 additions and 120 deletions

View File

@@ -36,7 +36,8 @@ public class SuggestionFeatureConfig implements FeatureConfig {
return Arrays.asList(
SuggestionFeatureMode.SUGGESTION_REMINDER,
SuggestionFeatureMode.SUGGESTION_BUTTONS,
SuggestionFeatureMode.SUGGESTION_AUTO_EVALUATE);
SuggestionFeatureMode.SUGGESTION_AUTO_EVALUATE,
SuggestionFeatureMode.SUGGESTION_THREAD);
}
@Override

View File

@@ -5,7 +5,10 @@ import lombok.Getter;
@Getter
public enum SuggestionFeatureMode implements FeatureMode {
SUGGESTION_REMINDER("suggestionReminder"), SUGGESTION_BUTTONS("suggestionButton"), SUGGESTION_AUTO_EVALUATE("suggestionAutoEvaluate");
SUGGESTION_REMINDER("suggestionReminder"),
SUGGESTION_BUTTONS("suggestionButton"),
SUGGESTION_AUTO_EVALUATE("suggestionAutoEvaluate"),
SUGGESTION_THREAD("suggestionThread");
private final String key;

View File

@@ -0,0 +1,20 @@
package dev.sheldan.abstracto.suggestion.model.template;
import lombok.Builder;
import lombok.Getter;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.User;
import java.time.Instant;
@Getter
@Builder
public class SuggestionThreadModel {
private Long suggestionId;
private User suggester;
private Member member;
private String text;
private Long serverId;
private Instant autoEvaluationTargetDate;
private Boolean autoEvaluationEnabled;
}

View File

@@ -15,6 +15,7 @@ import net.dv8tion.jda.api.entities.User;
public class SuggestionUpdateModel {
private Long suggestionId;
private SuggestionState state;
private Boolean buttonsActive;
private User suggester;
private Member member;
private String text;