Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ private boolean handleIsValidTitle(@NotNull CharSequence title, @NotNull IReplyC
return true;
}

event.reply(
"Sorry, but the title length (after removal of special characters) has to be between %d and %d."
.formatted(TITLE_COMPACT_LENGTH_MIN, TITLE_COMPACT_LENGTH_MAX))
event.reply("""
Sorry, but your title is invalid. Please pick a title where:
• length is between %d and %d
• must not contain the word 'help'
Thanks, and sorry for the inconvenience 👍
""".formatted(TITLE_COMPACT_LENGTH_MIN, TITLE_COMPACT_LENGTH_MAX))
.setEphemeral(true)
.queue();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.awt.Color;
import java.io.InputStream;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -207,7 +208,8 @@ static boolean isTitleValid(@NotNull CharSequence title) {
String titleCompact = TITLE_COMPACT_REMOVAL_PATTERN.matcher(title).replaceAll("");

return titleCompact.length() >= TITLE_COMPACT_LENGTH_MIN
&& titleCompact.length() <= TITLE_COMPACT_LENGTH_MAX;
&& titleCompact.length() <= TITLE_COMPACT_LENGTH_MAX
&& !titleCompact.toLowerCase(Locale.US).contains("help");
}

@NotNull
Expand Down