added templates required by assignable role places

changed the way how exceptions are templated
fixed generic exception template to handle text which might break the syntax
This commit is contained in:
Sheldan
2020-08-12 21:33:21 +02:00
parent 6565b68900
commit 48bc33860d
127 changed files with 313 additions and 7 deletions
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>assignable-roles</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>assignable-roles-templates-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,15 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>zip</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/resources</directory>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,14 @@
{
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "<#include "assignable_roles_config_embed_place_description">
<#include "assignable_roles_config_embed_role_header">:
<#list roles as role>
<#include "assignable_roles_config_embed_emote_description">
</#list>
"
}
@@ -0,0 +1,10 @@
{
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "<#include "assignable_role_places_overview_description">:
<#list places as place>`<#include "assignable_role_places_overview_place">`<#sep>, <#else> <#include "assignable_role_places_overview_no_places"></#list>
"
}
@@ -0,0 +1 @@
"description": "<#include "assignable_role_place_assigned_user_not_found_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "assignable_role_place_channel_does_not_exist_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "assignable_role_place_emote_already_defined_exception_text">"
@@ -0,0 +1 @@
"additionalMessage": "<#include "assignable_role_place_exists_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "assignable_role_place_not_found_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "assignable_role_place_post_not_found_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "assignable_role_place_role_not_usable_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "emote_not_in_assignable_role_place_exception_text">"
@@ -0,0 +1,21 @@
{
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "${place.text}",
"fields": [
<#list roles as role>
{
"name": "${role.emote.emoteRepr}",
"value": "${role.description}",
"inline": "${place.inline?string('true', 'false')}"
<#if role.forceNewMessage>
,"forceNewMessage": "true"
</#if>
}<#sep>,
<#else>
</#list>
]
}
@@ -12,14 +12,14 @@
<#if command.help??>
<#if command.help.templated>
<#include "help_command_embed_command_usage">: `<#include "${command.name}_usage">`
<#include "help_command_embed_command_detailed_help">: <#include "${command.name}_long_help">
**<#include "help_command_embed_command_usage">**: `<#include "${command.name}_usage">`
**<#include "help_command_embed_command_detailed_help">**: <#include "${command.name}_long_help">
<#if command.help.hasExample>
<#include "help_command_embed_command_example">: <#include "${command.name}_example">
</#if>
<#else>
<#include "help_command_embed_command_usage">: `${command.help.usage}`
<#include "help_command_embed_command_detailed_help">: ${command.help.longHelp}
**<#include "help_command_embed_command_usage">**: `${command.help.usage}`
**<#include "help_command_embed_command_detailed_help">**: ${command.help.longHelp}
<#if command.help.hasExample>
<#include "help_command_embed_command_example">:${command.help.example}
</#if>
@@ -35,7 +35,7 @@
</#if>
</#if>
<#include "help_command_embed_command_parameters">:
**<#include "help_command_embed_command_parameters">**:
<#if command.parameters??>
<#list command.parameters as parameter>
<#include "help_command_embed_command_description"> `${parameter.name}`: <#if parameter.templated?? && parameter.templated><#include "${command.name}_parameter_${parameter.name}"><#else>${(parameter.description)!""}</#if>
@@ -1 +1 @@
The channel ${channelId} was not found in guild ${guildId}.
The channel ${channelId} was not found.
@@ -0,0 +1 @@
"description": "<#include "command_parameter_value_wrong_type_exception_text">"
@@ -0,0 +1 @@
"description": "<#include "emote_not_available_in_server_exception_message">"
@@ -0,0 +1 @@
<#include "emote_not_found_in_db_exception_text">
@@ -0,0 +1,23 @@
{
"author": {
"name": "${user.member.effectiveName}",
"avatar": "${user.member.user.effectiveAvatarUrl}"
},
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"preventEmptyEmbed": "true",
<#if template?has_content>
<#if template.templateModel?has_content>
<#assign model=template.templateModel/>
<#assign rendered><#include "${template.templateName}"></#assign>
${rendered?js_string}
</#if>
<#elseif throwable.localizedMessage?has_content>
"description": "${throwable.localizedMessage?js_string}"
<#else>
"description": "${throwable.class.simpleName?js_string}"
</#if>
}
@@ -0,0 +1 @@
"description": "<#include "role_disabled_exception_message">"
+1
View File
@@ -21,6 +21,7 @@
<module>moderation</module>
<module>modmail</module>
<module>utility</module>
<module>assignable-roles</module>
</modules>
</project>