[AB-234] allow templates have individual (additional) allowed mention configurations

adding primary keys to command disabled and command cooldown group
exposing service method to retrieve the channel for a post target
This commit is contained in:
Sheldan
2021-04-24 02:05:15 +02:00
parent 49a9598062
commit fa4c455ca2
14 changed files with 106 additions and 41 deletions

View File

@@ -3,11 +3,11 @@ package dev.sheldan.abstracto.core.service;
import dev.sheldan.abstracto.core.models.database.AllowedMention;
import net.dv8tion.jda.api.entities.Message;
import java.util.List;
import java.util.Set;
public interface AllowedMentionService {
boolean allMentionsAllowed(Long serverId);
List<Message.MentionType> getAllowedMentionTypesForServer(Long serverId);
Set<Message.MentionType> getAllowedMentionTypesForServer(Long serverId);
void allowMentionForServer(Message.MentionType mentionType, Long serverId);
void disAllowMentionForServer(Message.MentionType mentionType, Long serverId);
AllowedMention getDefaultAllowedMention();

View File

@@ -25,6 +25,7 @@ public interface PostTargetService {
List<CompletableFuture<Message>> editOrCreatedInPostTarget(Long messageId, MessageToSend messageToSend, PostTargetEnum postTarget, Long serverId);
void throwIfPostTargetIsNotDefined(PostTargetEnum name, Long serverId);
boolean postTargetDefinedInServer(PostTargetEnum name, Long serverId);
PostTarget getPostTarget(PostTargetEnum postTargetName, Long serverId);
boolean validPostTarget(String name);
List<PostTarget> getPostTargets(AServer server);
List<String> getAvailablePostTargets();

View File

@@ -0,0 +1,15 @@
package dev.sheldan.abstracto.core.templating.model;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
public class MessageConfig {
private boolean allowsRoleMention;
private boolean allowsEveryoneMention;
@Builder.Default
private boolean allowsUserMention = true;
}

View File

@@ -29,6 +29,7 @@ public class MessageToSend {
* The file handle to send attached to the message.
*/
private File fileToSend;
private MessageConfig messageConfig;
public boolean hasFileToSend() {
return fileToSend != null;