fix ExecutableSlashCommandDefinition toString method with all various checks
All checks were successful
github-mirror / push-github (push) Successful in 4s
Build / Gradle-Build (push) Successful in 33s
Publish / Gradle-Publish (push) Successful in 33s
Test / Gradle-Test (push) Successful in 39s

This commit is contained in:
Tueem 2024-12-19 22:11:06 +01:00
parent 3691434f66
commit 455fc4955f
Signed by: tueem
GPG Key ID: F2CE0513D231AD7A

View File

@ -32,9 +32,13 @@ public record ExecutableSlashCommandDefinition(
@Override
public final String toString() {
return applicationCommand.name() +
subCommandGroup != null ? "::" + subCommand.name() : "" +
subCommand != null ? "::" + subCommand.name() : "";
StringBuilder builder = new StringBuilder();
builder.append(applicationCommand.name());
if (subCommandGroup != null && subCommandGroup.name() != null)
builder.append("::").append(subCommandGroup.name());
if (subCommand != null && subCommand.name() != null)
builder.append("::").append(subCommand.name());
return builder.toString();
}
public boolean isRootCommand() {