From 5ba2f2a2f8bc124b575d95c459166779ed374485 Mon Sep 17 00:00:00 2001 From: Sheldan <5037282+Sheldan@users.noreply.github.com> Date: Tue, 4 Feb 2025 23:01:50 +0100 Subject: [PATCH] [AB-xxx] adding support to have a different template for user command descriptions enabling user command for currency conversion command --- .../currencyconversion/command/ConvertCurrency.java | 1 + .../core/interaction/slash/SlashCommandServiceBean.java | 5 ++++- abstracto-application/pom.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/abstracto-application/abstracto-modules/webservices/webservices-impl/src/main/java/dev/sheldan/abstracto/webservices/currencyconversion/command/ConvertCurrency.java b/abstracto-application/abstracto-modules/webservices/webservices-impl/src/main/java/dev/sheldan/abstracto/webservices/currencyconversion/command/ConvertCurrency.java index 791d78ffa..c2056845a 100644 --- a/abstracto-application/abstracto-modules/webservices/webservices-impl/src/main/java/dev/sheldan/abstracto/webservices/currencyconversion/command/ConvertCurrency.java +++ b/abstracto-application/abstracto-modules/webservices/webservices-impl/src/main/java/dev/sheldan/abstracto/webservices/currencyconversion/command/ConvertCurrency.java @@ -127,6 +127,7 @@ public class ConvertCurrency extends AbstractConditionableCommand { .enabled(true) .rootCommandName(WebServicesSlashCommandNames.CONVERSION) .commandName("currency") + .userInstallable(true) .build(); return CommandConfiguration.builder() diff --git a/abstracto-application/core/core-impl/src/main/java/dev/sheldan/abstracto/core/interaction/slash/SlashCommandServiceBean.java b/abstracto-application/core/core-impl/src/main/java/dev/sheldan/abstracto/core/interaction/slash/SlashCommandServiceBean.java index 36753697a..8e42547be 100644 --- a/abstracto-application/core/core-impl/src/main/java/dev/sheldan/abstracto/core/interaction/slash/SlashCommandServiceBean.java +++ b/abstracto-application/core/core-impl/src/main/java/dev/sheldan/abstracto/core/interaction/slash/SlashCommandServiceBean.java @@ -78,7 +78,10 @@ public class SlashCommandServiceBean implements SlashCommandService { String internalCommandName = commandConfiguration.getName(); if(!isTemplated) { description = commandConfiguration.getDescription(); - } else { + } else if(commandConfiguration.isUserInstallable() && userCommandsOnly) { + description = templateService.renderSimpleTemplate(internalCommandName + "_description_user", serverId); + } + else { description = templateService.renderSimpleTemplate(internalCommandName + "_description", serverId); } String rootName = userCommandsOnly ? StringUtils.defaultString(slashConfig.getUserSlashCompatibleRootName(), slashConfig.getSlashCompatibleRootName()) : slashConfig.getSlashCompatibleRootName(); diff --git a/abstracto-application/pom.xml b/abstracto-application/pom.xml index e2206334b..0e23a32e8 100644 --- a/abstracto-application/pom.xml +++ b/abstracto-application/pom.xml @@ -33,7 +33,7 @@ scm:git:${project.scm.url} scm:git:${project.scm.url} https://github.com/Sheldan/abstracto.git - v1.5.62 + v1.6.0