mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-24 13:44:33 +00:00
moved some more templates to template config
fixed usage of post target exceptions
This commit is contained in:
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.service;
|
||||
import dev.sheldan.abstracto.core.config.DynamicKeyLoader;
|
||||
import dev.sheldan.abstracto.core.exception.ChannelNotFoundException;
|
||||
import dev.sheldan.abstracto.core.exception.GuildException;
|
||||
import dev.sheldan.abstracto.core.exception.PostTargetNotFoundException;
|
||||
import dev.sheldan.abstracto.core.exception.PostTargetNotValidException;
|
||||
import dev.sheldan.abstracto.core.service.management.PostTargetManagement;
|
||||
import dev.sheldan.abstracto.core.models.database.PostTarget;
|
||||
@@ -70,7 +71,7 @@ public class PostTargetServiceBean implements PostTargetService {
|
||||
return postTarget;
|
||||
} else {
|
||||
log.error("PostTarget {} in server {} was not found!", postTargetName, serverId);
|
||||
throw new PostTargetNotValidException(postTargetName);
|
||||
throw new PostTargetNotFoundException(postTargetName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +172,7 @@ public class PostTargetServiceBean implements PostTargetService {
|
||||
public void throwIfPostTargetIsNotDefined(String name, Long serverId) {
|
||||
PostTarget postTarget = postTargetManagement.getPostTarget(name, serverId);
|
||||
if(postTarget == null) {
|
||||
throw new PostTargetNotValidException(name);
|
||||
throw new PostTargetNotValidException(name, dynamicKeyLoader.getPostTargetsAsList());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package dev.sheldan.abstracto.core.service.management;
|
||||
|
||||
import dev.sheldan.abstracto.core.config.DynamicKeyLoader;
|
||||
import dev.sheldan.abstracto.core.exception.ChannelNotFoundException;
|
||||
import dev.sheldan.abstracto.core.exception.PostTargetNotFoundException;
|
||||
import dev.sheldan.abstracto.core.exception.PostTargetNotValidException;
|
||||
import dev.sheldan.abstracto.core.models.database.AChannel;
|
||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import dev.sheldan.abstracto.core.models.database.PostTarget;
|
||||
@@ -36,7 +36,7 @@ public class PostTargetManagementBean implements PostTargetManagement {
|
||||
@Override
|
||||
public PostTarget createPostTarget(String name, AServer server, AChannel targetChannel) {
|
||||
if(!postTargetService.validPostTarget(name)) {
|
||||
throw new PostTargetNotFoundException(name, dynamicKeyLoader.getPostTargetsAsList());
|
||||
throw new PostTargetNotValidException(name, dynamicKeyLoader.getPostTargetsAsList());
|
||||
}
|
||||
log.info("Creating post target {} pointing towards {}", name, targetChannel);
|
||||
PostTarget build = PostTarget.builder().name(name).channelReference(targetChannel).serverReference(server).build();
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Core
|
||||
@@ -1 +1 @@
|
||||
Command was not found.
|
||||
<#include "command_not_found_text">
|
||||
@@ -1 +1 @@
|
||||
Feature has been disabled. Necessary feature is: <#include "${featureConfig.feature.key}_feature">, you can enable it by executing `enable ${featureConfig.feature.key}`.
|
||||
<#assign featureName><#include "${featureConfig.feature.key}_feature"></#assign><#assign featureKey>${featureConfig.feature.key}</#assign><#include "feature_disabled_text">
|
||||
@@ -1 +1 @@
|
||||
Feature ${featureName} not available. The available features are: ${availableFeatures?join(", ")}
|
||||
<#assign availableFeatures>${availableFeatures?join(", ")}</#assign><#include "feature_not_found_text">
|
||||
@@ -1 +1 @@
|
||||
The targeted user is immune against this command, because of the role: ${role.name}.
|
||||
<#assign roleName>${role.name}</#assign> <#include "immune_role_text">
|
||||
@@ -1 +1 @@
|
||||
The necessary parameters were not found. A '${class.simpleName}' was expected as '${parameterName}'. Consult help to see the correct syntax.
|
||||
<#assign expectedType>${class.simpleName}</#assign><#include "incorrect_parameters_text">
|
||||
@@ -1 +1 @@
|
||||
Insufficient parameters: ${parameterName} was not found.
|
||||
<#include "insufficient_parameters_text">
|
||||
@@ -1 +1 @@
|
||||
You lack the necessary role to execute this command. One of the following is needed: <#list allowedRoles as role>${role.name}<#sep>,<#else>None configured.</#list>
|
||||
<#assign roles><#list allowedRoles as role>${role.name}<#sep>,<#else>None configured.</#list></#assign><#include "insufficient_role_text">
|
||||
@@ -1 +1 @@
|
||||
The parameter ${parameterName} had a too large value: ${actualLength}. The maximum is: ${maximumLength}.
|
||||
<#include "parameter_too_long_text">
|
||||
Reference in New Issue
Block a user