added mechanism to dynamically load properties defining postTargets and valid emoteNames

changed the output of the exception message
refactored emote management service
added service to define whether or not an emote is usable by the bot
This commit is contained in:
Sheldan
2020-03-22 10:26:58 +01:00
parent 9e9eb615c0
commit d95382b589
25 changed files with 246 additions and 100 deletions

View File

@@ -1,14 +1,22 @@
package dev.sheldan.abstracto.core.management;
import dev.sheldan.abstracto.core.models.database.AEmote;
import dev.sheldan.abstracto.core.models.database.AServer;
import net.dv8tion.jda.api.entities.Emote;
public interface EmoteManagementService {
AEmote loadEmote(Long id);
AEmote createCustomEmote(String name, String emoteKey, Long emoteId, Boolean animated, Long serverId);
AEmote createCustomEmote(String name, String emoteKey, Long emoteId, Boolean animated, AServer server);
AEmote createDefaultEmote(String name, String emoteKey, Long serverId);
AEmote createDefaultEmote(String name, String emoteKey, AServer server);
AEmote loadEmoteByName(String name, Long serverId);
AEmote loadEmoteByName(String name, AServer server);
AEmote setEmoteToCustomEmote(String name, String emoteKey, Long emoteId, Boolean animated, Long serverId);
AEmote setEmoteToCustomEmote(String name, Emote emote, Long serverId);
AEmote setEmoteToDefaultEmote(String name, String emoteKey, Long serverId);
boolean emoteExists(String name, Long serverId);
boolean emoteExists(String name, AServer server);
AEmote createCustomEmote(String name, String emoteKey, Long emoteId, Boolean animated);
AEmote createDefaultEmote(String name, String emoteKey);
}

View File

@@ -32,14 +32,4 @@ public class PostTarget {
@Getter @Setter
private AServer serverReference;
public static String JOIN_LOG = "joinLog";
public static String LEAVE_LOG = "leaveLog";
public static String WARN_LOG = "warnLog";
public static String KICK_LOG = "kickLog";
public static String BAN_LOG = "banLog";
public static String EDIT_LOG = "editLog";
public static String DELETE_LOG = "deleteLog";
public static String SUGGESTIONS = "suggestions";
public static List<String> AVAILABLE_POST_TARGETS = Arrays.asList(JOIN_LOG, LEAVE_LOG, WARN_LOG, KICK_LOG, BAN_LOG, EDIT_LOG, DELETE_LOG, SUGGESTIONS);
}

View File

@@ -0,0 +1,7 @@
package dev.sheldan.abstracto.core.service;
import net.dv8tion.jda.api.entities.Emote;
public interface EmoteService {
boolean isEmoteUsableByBot(Emote emote);
}