Improve urban dictionary parsing
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6fcd3b4cdf
commit
d1dc71dde9
@ -95,7 +95,7 @@ public class UrbanDictionaryCommand implements MessageCommand
|
|||||||
.replaceAll("<br\\s*?>", "\n") // keep newlines
|
.replaceAll("<br\\s*?>", "\n") // keep newlines
|
||||||
.replaceAll("<.*?>", ""); // remove all other html tags
|
.replaceAll("<.*?>", ""); // remove all other html tags
|
||||||
// discord only allows 1024 characters for embed fields
|
// 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);
|
plaintextMeanings.add(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ public class UrbanDictionaryCommand implements MessageCommand
|
|||||||
.replaceAll("<br\\s*?>", "\n") // keep newlines
|
.replaceAll("<br\\s*?>", "\n") // keep newlines
|
||||||
.replaceAll("<.*?>", ""); // remove all other html tags
|
.replaceAll("<.*?>", ""); // remove all other html tags
|
||||||
// discord only allows 1024 characters for embed fields
|
// 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);
|
plaintextExamples.add(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user