[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) .enabled(true)
.rootCommandName(WebServicesSlashCommandNames.CONVERSION) .rootCommandName(WebServicesSlashCommandNames.CONVERSION)
.commandName("currency") .commandName("currency")
.userInstallable(true)
.build(); .build();
return CommandConfiguration.builder() return CommandConfiguration.builder()

View File

@@ -78,7 +78,10 @@ public class SlashCommandServiceBean implements SlashCommandService {
String internalCommandName = commandConfiguration.getName(); String internalCommandName = commandConfiguration.getName();
if(!isTemplated) { if(!isTemplated) {
description = commandConfiguration.getDescription(); description = commandConfiguration.getDescription();
} else { } else if(commandConfiguration.isUserInstallable() && userCommandsOnly) {
description = templateService.renderSimpleTemplate(internalCommandName + "_description_user", serverId);
}
else {
description = templateService.renderSimpleTemplate(internalCommandName + "_description", serverId); description = templateService.renderSimpleTemplate(internalCommandName + "_description", serverId);
} }
String rootName = userCommandsOnly ? StringUtils.defaultString(slashConfig.getUserSlashCompatibleRootName(), slashConfig.getSlashCompatibleRootName()) : slashConfig.getSlashCompatibleRootName(); String rootName = userCommandsOnly ? StringUtils.defaultString(slashConfig.getUserSlashCompatibleRootName(), slashConfig.getSlashCompatibleRootName()) : slashConfig.getSlashCompatibleRootName();

View File

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