[AB-xxx] adding support to have a different template for user command descriptions

enabling user command for currency conversion command
This commit is contained in:
Sheldan
2025-02-04 23:01:50 +01:00
parent ce234f986e
commit 5ba2f2a2f8
3 changed files with 6 additions and 2 deletions

View File

@@ -127,6 +127,7 @@ public class ConvertCurrency extends AbstractConditionableCommand {
.enabled(true)
.rootCommandName(WebServicesSlashCommandNames.CONVERSION)
.commandName("currency")
.userInstallable(true)
.build();
return CommandConfiguration.builder()

View File

@@ -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();

View File

@@ -33,7 +33,7 @@
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<url>https://github.com/Sheldan/abstracto.git</url>
<tag>v1.5.62</tag>
<tag>v1.6.0</tag>
</scm>
<repositories>