You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -74,7 +76,7 @@ public void execute(@NotNull SlashCommandInteractionEvent event) {
74
76
.filter(m -> !m.getAuthor().isBot()).findFirst()
75
77
.orElse(null);
76
78
if (target != null) {
77
-
event.getHook().sendMessageFormat("```%s\n%s\n```", format, StringUtils.standardSanitizer().compute(target.getContentRaw()))
79
+
event.getHook().sendMessageFormat("```%s\n%s\n```", format, IndentationHelper.formatIndentation(StringUtils.standardSanitizer().compute(target.getContentRaw()),IndentationHelper.IndentationType.valueOf(indentation)))
78
80
.setAllowedMentions(List.of())
79
81
.setComponents(buildActionRow(target))
80
82
.queue();
@@ -89,7 +91,7 @@ public void execute(@NotNull SlashCommandInteractionEvent event) {
* Aims to indent the given String using the pattern provided. Will return the String unchanged if {@link IndentationHelper.IndentationType#NULL} is passed as the IndentationType parameter.
103
+
*
104
+
* @param text The text that should be indented.
105
+
* @param type The type of indentation to be used.
106
+
* @return The indented String with the format specified.
for (inti = 0, k = 0; i < unformatted.length; i++) {
34
+
assertEquals(formatted[k++], IndentationHelper.formatIndentation(unformatted[i], IndentationHelper.IndentationType.FOUR_SPACES), "Method failed to format a text with four spaces correctly");
35
+
assertEquals(formatted[k++], IndentationHelper.formatIndentation(unformatted[i], IndentationHelper.IndentationType.TWO_SPACES), "Method failed to format a text with two spaces correctly");
36
+
assertEquals(formatted[k++], IndentationHelper.formatIndentation(unformatted[i], IndentationHelper.IndentationType.TABS), "Method failed to format a text with tabs correctly.");
37
+
assertEquals(formatted[k++], IndentationHelper.formatIndentation(unformatted[i], IndentationHelper.IndentationType.NULL), "Method returned a String not matching the input");
0 commit comments