From 0f54211ecdcf9bf9b9d603eec8fbc26923d5246c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 19 Dec 2022 22:53:25 +0100 Subject: [PATCH] Improve urban dictionary parsing --- .../hidekobot/commands/message/UrbanDictionaryCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java index 6e96c0c..98ecff0 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/message/UrbanDictionaryCommand.java @@ -95,7 +95,7 @@ public class UrbanDictionaryCommand implements MessageCommand .replaceAll("", "\n") // keep newlines .replaceAll("<.*?>", ""); // remove all other html tags // discord only allows 1024 characters for embed fields - if(text.length() > 1024) text = text.substring(0, 1023); + if(text.length() > 1024) text = text.substring(0, 1020) + "..."; plaintextMeanings.add(text); } @@ -111,7 +111,7 @@ public class UrbanDictionaryCommand implements MessageCommand .replaceAll("", "\n") // keep newlines .replaceAll("<.*?>", ""); // remove all other html tags // discord only allows 1024 characters for embed fields - if(text.length() > 1024) text = text.substring(0, 1023); + if(text.length() > 1024) text = text.substring(0, 1020) + "..."; plaintextExamples.add(text); }