refactored command responses to use a central place for configuration in an extra module

fixed makeAffected role parameter
made command check name case insensitive
added name to parameter for decayAllWarnings
removed simple log from message edited listener
This commit is contained in:
Sheldan
2020-04-30 22:29:49 +02:00
parent d5482fabd4
commit 59dc8c602a
312 changed files with 284 additions and 154 deletions

View File

@@ -12,7 +12,7 @@
"b": 255
},
"description": "
Rank | Name | Experience | Level | Messages
<#include "leaderboard_rank_column"> | <#include "leaderboard_name_column"> | <#include "leaderboard_experience_column"> | <#include "leaderboard_level_column"> | <#include "leaderboard_messages_column">
<#list userExperiences as user>
<@userDisplay user=user />
</#list>

View File

@@ -10,27 +10,27 @@
},
"fields": [
{
"name": "XP",
"name": "<#include "rank_xp_field_title">",
"value": "${rankUser.experience.experience}",
"inline": "true"
},
{
"name": "Level",
"name": "<#include "rank_level_field_title">",
"value": "${rankUser.experience.currentLevel.level}",
"inline": "true"
},
{
"name": "Messages",
"name": "<#include "rank_messages_field_title">",
"value": "${rankUser.experience.messageCount}",
"inline": "true"
},
{
"name": "XP to next Level",
"name": "<#include "rank_to_next_level_field_title">",
"value": "${experienceToNextLevel}",
"inline": "true"
},
{
"name": "Rank",
"name": "<#include "rank_rank_field_title">",
"value": "${rankUser.rank}",
"inline": "true"
}

View File

@@ -1,3 +1,3 @@
{
"additionalMessage": "Updating users: ${currentCount}/${totalUserCount}."
"additionalMessage": "<#include "syncExpRoles_updating_users_label">: ${currentCount}/${totalUserCount}."
}

View File

@@ -33,7 +33,7 @@ public class DecayAllWarnings extends AbstractConditionableCommand {
@Override
public CommandConfiguration getConfiguration() {
List<Parameter> parameters = new ArrayList<>();
Parameter logWarnings = Parameter.builder().optional(true).type(Boolean.class).build();
Parameter logWarnings = Parameter.builder().optional(true).name("writeLog").type(Boolean.class).build();
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
parameters.add(logWarnings);
return CommandConfiguration.builder()

View File

@@ -42,8 +42,6 @@ public class MessageEditedListener implements MessageTextUpdatedListener {
.messageChannel(messageAfter.getTextChannel())
.guild(messageAfter.getGuild())
.member(messageAfter.getMember()).build();
String simpleMessageUpdatedMessage = templateService.renderTemplate(MESSAGE_EDITED_TEMPLATE, log);
postTargetService.sendTextInPostTarget(simpleMessageUpdatedMessage, EDIT_LOG_TARGET, messageAfter.getGuild().getIdLong());
MessageToSend message = templateService.renderEmbedTemplate(MESSAGE_EDITED_TEMPLATE, log);
postTargetService.sendEmbedInPostTarget(message, EDIT_LOG_TARGET, messageBefore.getServerId());
}

View File

@@ -1 +0,0 @@
User ${bannedUser.effectiveName} (${bannedUser.asMention}) has been banned with reason ${reason}.

View File

@@ -1 +0,0 @@
User ${kickedUser.effectiveName} (${kickedUser.asMention}) has been kicked with reason: ${reason}.

View File

@@ -4,7 +4,7 @@
"avatar": "${mutedUser.user.effectiveAvatarUrl}"
},
"title": {
"title": "User has been muted"
"title": "<#include "mute_log_title">"
},
"color" : {
"r": 200,
@@ -13,32 +13,32 @@
},
"fields": [
{
"name": "Muted User",
"name": "<#include "mute_log_muted_user_field_title">",
"value": "${mutedUser.effectiveName} ${mutedUser.asMention} (${mutedUser.idLong?c})"
},
{
"name": "Muted by",
"name": "<#include "mute_log_muting_user_field_title">",
"value": "${mutingUser.effectiveName} ${mutingUser.asMention} (${mutingUser.idLong?c})"
},
{
"name": "Location of the mute",
"name": "<#include "mute_log_mute_location_field_title">",
"value": "[${messageChannel.name}](${message.jumpUrl})"
},
{
"name": "Reason",
"name": "<#include "mute_log_mute_reason_field_title">",
"value": "${mute.reason}"
},
{
"name": "Muted for",
"name": "<#include "mute_log_mute_duration_field_title">",
"value": "${fmtDuration(muteDuration)}"
},
{
"name": "Muted until",
"name": "<#include "mute_log_muted_until_field_title">",
"value": "${formatInstant(mute.muteTargetDate, "yyyy-MM-dd HH:mm:ss")}"
}
],
"footer": {
"text": "Mute #${mute.id}"
"text": "<#include "mute_log_mute_id_footer"> #${mute.id}"
},
"timeStamp": "${mute.muteDate}"
}

View File

@@ -6,7 +6,7 @@
},
</#if>
"title": {
"title": "User has been unmuted"
"title": "<#include "unMute_log_title">"
},
"color" : {
"r": 200,
@@ -15,41 +15,41 @@
},
"fields": [
{
"name": "Unmuted User",
"name": "<#include "unMute_log_unmuted_user_field_title">",
<#if unMutedUser?has_content>
"value": "${unMutedUser.effectiveName} ${unMutedUser.asMention} (${unMutedUser.idLong?c})"
<#else>
"value": "User has left the server (${mute.mutedUser.userReference.id?c})"
"value": "<#include "user_left_server"> (${mute.mutedUser.userReference.id?c})"
</#if>
},
{
"name": "Muted by",
"name": "<#include "mute_log_muting_user_field_title">",
<#if mutingUser?has_content>
"value": "${mutingUser.effectiveName} ${mutingUser.asMention} (${mutingUser.idLong?c})"
<#else>
"value": "User has left the server (${mute.mutingUser.userReference.id?c})"
"value": "<#include "user_left_server"> (${mute.mutingUser.userReference.id?c})"
</#if>
},
{
"name": "Location of the mute",
"name": "<#include "mute_log_mute_location_field_title">",
"value": "[Link](${messageUrl})"
},
{
"name": "Muted since",
"name": "<#include "unMute_log_muted_since_field_title">",
"value": "${formatInstant(mute.muteDate, "yyyy-MM-dd HH:mm:ss")}"
},
{
"name": "Muted for",
"name": "<#include "mute_log_mute_duration_field_title">",
"value": "${fmtDuration(muteDuration)}"
},
{
"name": "Reason",
"name": "<#include "mute_log_mute_reason_field_title">",
"value": "${mute.reason}"
}
],
"footer": {
"text": "Mute #${mute.id}"
"text": "<#include "mute_log_mute_id_footer"> #${mute.id}"
},
"timeStamp": "${unmuteDate}"
}

View File

@@ -4,7 +4,7 @@
"avatar": "${warnedUser.user.effectiveAvatarUrl}"
},
"title": {
"title": "User has been warned"
"title": "<#include "warn_log_title">"
},
"color" : {
"r": 200,
@@ -13,29 +13,29 @@
},
"fields": [
{
"name": "Warned User",
"name": "<#include "warn_log_warned_user_field_title">",
"value": "${warnedUser.effectiveName} ${warnedUser.asMention} (${warnedUser.idLong?c})"
},
<#if warningUser?has_content>
{
"name": "Warned by",
"name": "<#include "warn_log_warning_user_field_title">",
"value": "${warningUser.effectiveName} ${warningUser.asMention} (${warningUser.idLong?c})"
},
</#if>
<#if warning?has_content>
{
"name": "Location of the incident",
"name": "<#include "warn_log_warn_location_field_title">",
"value": "[${messageChannel.name}](${message.jumpUrl})"
},
</#if>
{
"name": "Reason",
"name": "<#include "warn_log_warn_reason_field_title">",
"value": "${reason}"
}
],
"footer": {
<#if warningUser?has_content>
"text": "Warning #${warning.id}"
"text": "<#include "warn_log_warn_id_footer"> #${warning.id}"
</#if>
}
}

View File

@@ -2,11 +2,11 @@
"imageUrl": "${imageUrl}",
"fields": [
{
"name": "Direct Url",
"value": "[Link](${imageUrl})"
"name": "<#include "messageDeleted_attachment_link_field_title">",
"value": "[<#include "messageDeleted_attachment_link_display_text">](${imageUrl})"
}
],
"footer": {
"text": "Attachment #${counter}"
"text": "<#include "messageDeleted_attachment_footer"> #${counter}"
}
}

View File

@@ -3,7 +3,7 @@
"name": "${member.effectiveName}#${member.user.discriminator}",
"avatar": "${member.user.effectiveAvatarUrl}"
},
"description": "Message from ${member.effectiveName}#${member.user.discriminator} (${member.idLong?c}) removed in ${messageChannel.asMention}",
"description": "<#include "messageDeleted_description_text">",
"color" : {
"r": 200,
"g": 0,
@@ -11,11 +11,11 @@
},
"fields": [
{
"name": ":x: Original Message: ",
"name": "<#include "messageDeleted_original_message_field_title">",
"value": "${message.content}"
},
{
"name": "Link",
"name": "<#include "messageDeleted_message_link_field_title">",
"value": "[${messageChannel.name}](${message.messageUrl})"
}
]

View File

@@ -1,2 +0,0 @@
Message from ${member.effectiveName} (${member.idLong?c}) deleted in ${messageChannel.asMention}.
Message: ${message.content}

View File

@@ -3,7 +3,7 @@
"name": "${member.effectiveName}#${member.user.discriminator}",
"avatar": "${member.user.effectiveAvatarUrl}"
},
"description": "Message from ${member.effectiveName}#${member.user.discriminator} (${member.idLong?c}) edited in ${messageChannel.asMention}",
"description": "<#include "messageEdited_description_text">",
"color" : {
"r": 200,
"g": 0,
@@ -11,15 +11,15 @@
},
"fields": [
{
"name": "Original Message: ",
"name": "<#include "messageEdited_original_message_field_title">",
"value": "${messageBefore.content}"
},
{
"name": "New Message: ",
"name": "<#include "messageEdited_new_message_field_title">",
"value": "${messageAfter.contentRaw}"
},
{
"name": "Jump link",
"name": "<#include "messageEdited_link_field_title">",
"value": "[${messageChannel.name}](${messageBefore.messageUrl})"
}
]

View File

@@ -1,3 +0,0 @@
Message from ${member.effectiveName} (${member.idLong?c}) edited in ${messageChannel.asMention}.
Before: ${messageBefore.content}
After: ${messageAfter.contentRaw}

View File

@@ -8,10 +8,8 @@
"b": 255
},
"description": "<#list warnings as warning>
<#if warning.warnedMember??>${warning.warnedMember.asMention} (${warning.warnedMember.id})<#else>${warning.warning.warnedUser.userReference.id?c}</#if> was warned on ${formatInstant(warning.warning.warnDate, "yyyy-MM-dd HH:mm:ss")}
with reason `${warning.warning.reason}` by <#if warning.warningMember??>${warning.warningMember.asMention} (${warning.warningMember.id})<#else>${warning.warning.warningUser.userReference.id?c}</#if>
<#if warning.warnedMember??><#assign warnedUser>${warning.warnedMember.asMention} (${warning.warnedMember.id})</#assign><#else><#assign warnedUser> ${warning.warning.warnedUser.userReference.id?c}</#assign></#if> <#if warning.warningMember??><#assign warningUser> ${warning.warningMember.asMention} (${warning.warningMember.id})</#assign><#else><#assign warningUser>${warning.warning.warningUser.userReference.id?c}</#assign></#if> <#include "warnDecay_log_warn_entry">
<#else>
No warnings to decay.
<#include "warnDecay_log_no_warnings">
</#list>"
}

View File

@@ -8,19 +8,19 @@
"g": 0,
"b": 255
},
"description": "You wanted to be reminded.",
"description": "<#include "remind_reminder_description">",
"fields": [
{
"name": "Duration",
"name": "<#include "remind_reminder_duration_field_title">",
"value": "${fmtDuration(duration)}"
},
{
"name": "Note",
"name": "<#include "remind_reminder_note_field_title">",
"value": "${reminder.text}"
},
{
"name": "Link",
"value": "[Jump!](${messageUrl})"
"name": "<#include "remind_reminder_link_field_title">",
"value": "[<#include "remind_reminder_link_content_display_text">](${messageUrl})"
}
],
"additionalMessage": "${member.asMention}"

View File

@@ -1,4 +1,6 @@
{
<#assign id>${reminder.id}</#assign>
<#assign messageUrl>${message.jumpUrl}</#assign>
"author": {
"name": "${member.effectiveName}",
"avatar": "${member.user.effectiveAvatarUrl}"
@@ -8,6 +10,6 @@
"g": 0,
"b": 255
},
"description": "Scheduled reminder ${reminder.id} to remind you of [this](${message.jumpUrl})",
"description": "<#include "remind_reminding_description_text">",
"additionalMessage": "${member.asMention}"
}

View File

@@ -9,13 +9,14 @@
"b": 255
},
"title": {
"title": "Currently active reminders"
"title": "<#include "reminders_reminders_embed_title">"
},
"fields": [
<#list reminders as reminder>
{
"name": "Reminder ${reminder.id}",
"value": "Due on ${reminder.targetDate} with text ${reminder.text}"
<#assign id>${reminder.id}</#assign>
"name": "<#include "reminders_reminder_field_title">",
"value": "<#include "reminders_due_on">"
}
<#sep>,
</#list>

View File

@@ -1 +1 @@
**Name**: ${emote.name} **Link**: ${emote.imageUrl}
<#assign name> ${emote.name} </#assign> <#assign url> ${emote.imageUrl} </#assign>**<#include "showEmote_name">**: ${emote.name} **<#include "showEmote_link">**: ${emote.imageUrl}

View File

@@ -1,49 +1,51 @@
{
"title": {
"title": "Server starboard stats"
"title": "<#include "starStats_response_title">"
},
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "${starredMessages} starred messages with ${totalStars} stars in total",
"description": "<#include "startStats_description">",
"fields": [
{
"name": "Top starred posts",
"name": "<#include "starStats_top_starred_field_title">",
"value": "
<#list topPosts as post>
${badgeEmotes[post?index]} - ${post.starCount} :star: [Jump!](${post.messageUrl})
<#assign badge>${badgeEmotes[post?index]}</#assign><#assign count>${post.starCount}</assign><#assign link>${post.messageUrl}</#assign> <#include "starStats_starred_entry">
<#else>
No starred messages.
<#include "starStats_no_starred_messages">
</#list>
"
},
{
"name": "Top starrer",
"name": "<#include "starStats_top_starrer_field_title">",
"value": "
<#list starGiver as starrer>
<#assign badge>${badgeEmotes[starrer?index]}</#assign><#assign count>${starrer.starCount}</assign>
<#if starrer.member?has_content>
${badgeEmotes[starrer?index]} - ${starrer.starCount} :star: ${starrer.member.asMention}
<#assign user>${starrer.member.asMention}</#assign> <#include "starStats_starrer_entry">
<#else>
${badgeEmotes[starrer?index]} - ${starrer.starCount} :star: ${starrer.user.id?c} (Left the guild)
<#assign user>${starrer.user.id?c}</#assign> <#include "starStats_starrer_entry_left_guild_en_US.ftl">
</#if>
<#else>
No starred messages.
<#include "starStats_no_starred_messages">
</#list>
"
},
{
"name": "Top star receiver",
"name": "<#include "starStats_top_receiver_field_title">",
"value": "
<#list starReceiver as starred>
<#assign badge>${badgeEmotes[starred?index]}</#assign><#assign count>${starred.starCount}</assign>
<#if starred.member?has_content>
${badgeEmotes[starred?index]} - ${starred.starCount} :star: ${starred.member.asMention}
<#assign user>${starred.member.asMention}</#assign> <#include "starStats_receiver_entry">
<#else>
${badgeEmotes[starred?index]} - ${starred.starCount} :star: ${starred.user.id?c} (Left the guild)
<#assign user>${starred.user.id?c}</#assign> <#include "starStats_receiver_entry_left_guild">
</#if>
<#else>
No starred messages.
<#include "starStats_no_starred_messages">
</#list>
"
}

View File

@@ -8,22 +8,24 @@
"g": 0,
"b": 255
},
<#assign user>${member.effectiveName}</#assign>
<#assign id>${suggestion.id}</#assign>
<#if suggestion.state = "ACCEPTED">
"description": "~~${text}~~ \n✅ ${reason} - Accepted by ${member.effectiveName}",
"description": "~~${text}~~ \n✅ ${reason} - <#include "suggest_accepted_by">",
<#elseif suggestion.state = "REJECTED">
"description": "~~${text}~~ \n❌ ${reason} - Rejected by ${member.effectiveName}",
"description": "~~${text}~~ \n❌ ${reason} - <#include "suggest_rejected_by">",
<#else>
"description": "${text}",
</#if>
<#if suggestion.state = "ACCEPTED" || suggestion.state = "REJECTED">
"fields": [
{
"name": "Link",
"value": "[Jump](${originalMessageUrl})"
"name": "<#include "suggest_link_field_title">",
"value": "[<#include "suggest_link_display_value">](${originalMessageUrl})"
}
],
</#if>
"footer": {
"text": "Suggestion #${suggestion.id}"
"text": "<#include "suggest_suggestion_id_footer">"
}
}

View File

@@ -11,9 +11,9 @@
<#if embeddedMessage.content?has_content || embeddedMessage.embeds?size gt 0>
"description": "${embeddedMessage.content}
<#list embeddedMessage.embeds>
Embeds:
<#include "message_embed_embed_embeds_name">:
<#items as embed>
Description: <#if embed.description?has_content >${embed.description}</#if> <#if embed.imageUrl?has_content> ImageUrl: ${embed.imageUrl} </#if>
<#include "message_embed_embed_description">: <#if embed.description?has_content >${embed.description}</#if> <#if embed.imageUrl?has_content> <#include "message_embed_embed_image_url">: ${embed.imageUrl} </#if>
</#items>
</#list>
",
@@ -23,8 +23,11 @@
</#if>
"fields": [
{
"name": "Quoted by",
"value": "${embeddingUser.asMention} from [${sourceChannel.name}](${embeddedMessage.messageUrl})"
"name": "<#include "message_embed_embed_quoted_by_field_title">",
<#assign user>${embeddingUser.asMention}</#assign>
<#assign channelName>${sourceChannel.name}</#assign>
<#assign messageLink>${embeddedMessage.messageUrl}</#assign>
"value": "<#include "message_embed_embed_quoted_by_field_value">"
}
],
"timeStamp": "${embeddedMessage.timeCreated}"

View File

@@ -15,24 +15,29 @@
<#if message.content?has_content || message.embeds?size gt 0>
"description": "${message.content}
<#list message.embeds>
Embeds:
<#include "starboard_post_embed_embeds_name">:
<#items as embed>
Description: ${embed.description} <#if embed.imageUrl?has_content> ImageUrl: ${embed.imageUrl} </#if>
<#include "starboard_post_embed_description">: ${embed.description} <#if embed.imageUrl?has_content> <#include "starboard_post_embed_image_url">: ${embed.imageUrl} </#if>
</#items>
</#list>
",
</#if>
<#assign emote>${starLevelEmote}</#assign>
<#assign count>${starCount}</#assign>
<#assign messageId>${message.messageId?c}</#assign>
<#if channel?has_content>
"additionalMessage": "${starLevelEmote} ${starCount} ${channel.asMention} ID: ${message.messageId?c}",
<#assign channel>${channel.asMention}</#assign>
"additionalMessage": "<#include "starboard_post_embed_additional_message">",
<#else>
"additionalMessage": "${starLevelEmote} ${starCount} ${aChannel.id?c} ID: ${message.messageId?c}",
<#assign channel>${aChannel.id?c}</#assign>
"additionalMessage": "<#include "starboard_post_embed_additional_message">",
</#if>
<#if message.attachmentUrls?size gt 0>
"imageUrl": "${message.attachmentUrls[0]}",
</#if>
"fields": [
{
"name": "Original",
"name": "<#include "starboard_post_embed_original_field_title">",
<#if channel?has_content>
"value": "[${channel.name}](${message.messageUrl})"
<#else>

View File

@@ -30,7 +30,7 @@ public class CommandManagementServiceBean implements CommandManagementService {
public ACommand createCommand(String name, AModule module, AFeature feature) {
ACommand command = ACommand
.builder()
.name(name)
.name(name.toLowerCase())
.module(module)
.feature(feature)
.build();
@@ -40,7 +40,7 @@ public class CommandManagementServiceBean implements CommandManagementService {
@Override
public ACommand findCommandByName(String name) {
return commandRepository.findByName(name);
return commandRepository.findByName(name.toLowerCase());
}
@Override

View File

@@ -40,8 +40,7 @@ public class MakeAffected extends AbstractConditionableCommand {
@Override
public CommandResult execute(CommandContext commandContext) {
String name = (String) commandContext.getParameters().getParameters().get(0);
Long roleId = (Long) commandContext.getParameters().getParameters().get(1);
ARole role = roleManagementService.findRole(roleId);
ARole role = (ARole) commandContext.getParameters().getParameters().get(1);
if(featureManagementService.featureExists(name)) {
AFeature feature = featureManagementService.getFeature(name);
feature.getCommands().forEach(command ->

View File

@@ -1,12 +0,0 @@
package dev.sheldan.abstracto.core.repository;
import dev.sheldan.abstracto.core.models.database.AFeatureFlag;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface FeatureJobTriggerRepository extends JpaRepository<AFeatureJobTrigger, Long> {
List<AFeatureJobTrigger> findByFeature(AFeatureFlag featureFlag);
}

View File

@@ -1 +1 @@
The following features are available: ${features?join(", ")}
<#assign featureString>${features?join(", ")}</#assign><#include "disable_available_features">

View File

@@ -1 +1 @@
The following features are available: ${features?join(", ")}
<#assign featureString>${features?join(", ")}</#assign><#include "enable_available_features">

View File

@@ -1,6 +1,6 @@
{
"title": {
"title": "Currently available features"
"title": "<#include "features_embed_title">"
},
"color" : {
"r": 200,
@@ -9,7 +9,7 @@
},
"description": "
<#list features as feature>
${feature.featureFlag.enabled?string('✅', '❌')} **<#include "${feature.featureConfig.feature.key}_feature">** Key: `${feature.featureConfig.feature.key}`
${feature.featureFlag.enabled?string('✅', '❌')} **<#include "${feature.featureConfig.feature.key}_feature">** <#include "feature_embed_key">: `${feature.featureConfig.feature.key}`
</#list>
"
}

View File

@@ -1,48 +1,46 @@
{
"title": {
"title": "Help - Command ${command.name} details"
"title": "<#include "help_command_embed_title">"
},
"color" : {
"r": 200,
"g": 0,
"b": 255
},
"description": "Name: **${command.name}**
Description: <#if command.templated >
<#include "${command.name}_description">
<#else>
${command.description}
</#if>
"description": "<#include "help_command_embed_command_name">: **${command.name}**
<#include "help_command_embed_command_description">: <#if command.templated> <#include "${command.name}_description"> <#else> ${command.description} </#if>
<#if command.help??>
<#if command.help.templated>
Usage: `<#include "${command.name}_usage">`
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">
<#else>
Usage: `${command.help.usage}`
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>
<#if command.aliases?? && command.aliases?size gt 0>
Aliases: `${command.aliases?join("`, `")}`
<#include "help_command_embed_command_aliases">: `${command.aliases?join("`, `")}`
</#if>
Restrictions:
<#include "help_command_embed_command_description">:
<#if restricted?? && restricted>
Executable by:<#if allowedRoles??> <#list allowedRoles as allowedRole> ${allowedRole.asMention}<#sep>or<#else>Nobody</#list> </#if>
<#if immuneRoles?? > Immune roles: <#list immuneRoles as immuneRole> ${immuneRole.asMention}<#sep>or<#else>None</#list> </#if>
<#include "help_command_embed_command_description"><#if allowedRoles??> <#list allowedRoles as allowedRole> ${allowedRole.asMention}<#sep><#include "help_command_embed_or"><#else><#include "help_command_embed_command_executable_by_nobody"></#list> </#if>
<#if immuneRoles?? ><#include "help_command_embed_command_immune">: <#list immuneRoles as immuneRole> ${immuneRole.asMention}<#sep><#include "help_command_embed_or"><#else>None</#list> </#if>
<#else>
Not restricted
<#include "help_command_embed_command_not_restricted">
</#if>
</#if>
Parameters:
<#include "help_command_embed_command_parameters">:
<#if command.parameters??>
<#list command.parameters as parameter>
${parameter.name}: ${(parameter.description)!""}
Optional: ${parameter.optional?string('yes', 'no')}
<#include "help_command_embed_command_description"> `${parameter.name}`: ${(parameter.description)!""}
<#include "help_command_embed_command_optional"><#sep>
<#else>
No parameters
<#include "help_command_embed_command_no_parameters">
</#list>
<#else>
No parameters
<#include "help_command_embed_command_no_parameters">
</#if>
"
}

View File

@@ -1,6 +1,7 @@
{
<#assign name>${module.moduleInterface.info.name}</#assign>
"title": {
"title": "Help - Module ${module.moduleInterface.info.name} details"
"title": "<#include "help_module_embed_title">"
},
"color" : {
"r": 200,
@@ -8,15 +9,15 @@
"b": 255
},
"description": "
Module name: **${module.moduleInterface.info.name}**
Description: ${module.moduleInterface.info.description}
Commands:
<#include "help_module_embed_module_name">: **${module.moduleInterface.info.name}**
<#include "help_module_embed_module_description">: ${module.moduleInterface.info.description}
<#include "help_module_embed_commands">:
<#list module.commands as command>`${command.configuration.name}`<#sep>, </#list>
<#if module.subModules??>
Submodules: <#list module.subModules as module>`${module.info.name}`<#sep>, </#list>
<#include "help_module_embed_sub_modules">: <#list module.subModules as module>`${module.info.name}`<#sep>, </#list>
</#if>
",
"footer": {
"text": "Use 'help <command name>' for a detailed overview of this command."
"text": "<#include "help_command_embed_hint_footer">"
}
}

View File

@@ -1,6 +1,6 @@
{
"title": {
"title": "Help - Module overview"
"title": "<#include "help_modules_embed_title">"
},
"color" : {
"r": 200,
@@ -9,11 +9,11 @@
},
"description": "
<#list modules as module>
Module name: **${module.info.name}**
Description: ${module.info.description}
<#include "help_module_embed_module_name">: **${module.info.name}**
<#include "help_module_embed_module_description">: ${module.info.description}
</#list>
",
"footer": {
"text": "Use 'help <module name>' for a list of commands of this module."
"text": "<#include "help_modules_embed_footer_hint">"
}
}

View File

@@ -1,12 +1,15 @@
{
"title": {
"title": "Current configured channel groups"
"title": "<#include "listChannelGroups_embed_title">"
},
"color" : {
"r": 200,
"g": 0,
"b": 255
},
<#if groups?size = 0>
"description": "<#include "listChannelGroups_no_channel_group">",
</#if>
"fields": [
<#list groups as group>
{
@@ -18,6 +21,7 @@
</#list>
"
}<#sep>,
<#else>
</#list>
]
}

View File

@@ -1 +1 @@
Latency: ${latency} ms.
<#include "ping_latency_response">

View File

@@ -1 +1 @@
The provided post target is invalid. <#include "posttarget_no_target">
<#include "posttarget_invalid_post_target_response"> <#include "posttarget_no_target">

View File

@@ -1 +1 @@
The available post targets are: ${validPostTargets?join(", ")}
<#include "posttarget_available_post_targets">: ${validPostTargets?join(", ")}.

View File

@@ -1 +1 @@
User ${user.name}#${user.discriminator} (${user.asMention}) has joined the guild.
<#assign user>${user.name}#${user.discriminator} (${user.asMention})</#assign><#include "user_joined_text">

View File

@@ -1 +1 @@
User ${user.name}#${user.discriminator} (${userMention}) has left the guild.
<#assign user>${user.name}#${user.discriminator} (${user.asMention})</#assign><#include "user_left_text">

View File

@@ -49,6 +49,12 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>dev.sheldan.abstracto.templating</groupId>
<artifactId>template-config</artifactId>
<version>${project.version}</version>
</dependency>
<!-- modules containing commands -->
<dependency>

View File

@@ -20,6 +20,7 @@
<module>templating</module>
<module>abstracto-modules</module>
<module>scheduling</module>
<module>template-config</module>
</modules>

View File

@@ -0,0 +1,17 @@
<?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-application</artifactId>
<groupId>dev.sheldan.abstracto</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sheldan.abstracto.templating</groupId>
<artifactId>template-config</artifactId>
<packaging>jar</packaging>
</project>

View File

@@ -0,0 +1 @@
The following features are available: ${featureString}

View File

@@ -0,0 +1 @@
The following features are available: ${featureString}

Some files were not shown because too many files have changed in this diff Show More