Skip to content

Commit a1af405

Browse files
committed
ignore messages with codeblocks for close suggestions
1 parent 81d8681 commit a1af405

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/net/javadiscord/javabot/systems/help/HelpListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public void onMessageReceived(@NotNull MessageReceivedEvent event) {
106106

107107
private void replyCloseSuggestionIfPatternMatches(Message msg) {
108108
String content = msg.getContentRaw().toLowerCase();
109+
if (content.contains("```")) {
110+
return;
111+
}
109112
if(msg.getChannel().asThreadChannel().getOwnerIdLong() == msg.getAuthor().getIdLong()) {
110113
for (String[] detector : closeSuggestionDetectors) {
111114
if (doesMatchDetector(content, detector)) {

0 commit comments

Comments
 (0)