diff --git a/zyenyo-discord/pom.xml b/zyenyo-discord/pom.xml index 680ab5a..6d7b9cf 100644 --- a/zyenyo-discord/pom.xml +++ b/zyenyo-discord/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.seizoxu.zyenyo zyenyo - 0.3.06-beta + 0.3.07-beta ZyenyoBot diff --git a/zyenyo-discord/src/main/java/asynchronous/typing/TypeList.java b/zyenyo-discord/src/main/java/asynchronous/typing/TypeList.java index 61c157d..0b50c21 100644 --- a/zyenyo-discord/src/main/java/asynchronous/typing/TypeList.java +++ b/zyenyo-discord/src/main/java/asynchronous/typing/TypeList.java @@ -119,7 +119,7 @@ private void parseArguments() lengthString += args[j]; } - DoubleRange dr = parseRange(lengthString); + DoubleRange dr = parseRange(lengthString, true); lengthRange = new IntegerRange((int)dr.lowerBound(), (int)dr.upperBound()); } catch(NumberFormatException e) {e.printStackTrace();} @@ -136,7 +136,7 @@ private void parseArguments() lengthString += args[j]; } - trRange = parseRange(lengthString); + trRange = parseRange(lengthString, false); } catch(NumberFormatException e) {e.printStackTrace();} break; @@ -157,10 +157,11 @@ private void parseArguments() } - private DoubleRange parseRange(String rangeString) + private DoubleRange parseRange(String rangeString, boolean isLength) { if (rangeString.isBlank()) {return null;} + double addValue = (isLength) ? 50d : 0.1d; Pattern pattern = Pattern.compile("([<>]?)([0-9]+(?:\\.?[0-9]+)?)\\-?([0-9]+(?:\\.?[0-9]+)?)?"); Matcher matcher = pattern.matcher(rangeString); @@ -185,8 +186,8 @@ else if (sign.equals("<")) // upperBound would have changed for signs, so we can ask again here, in cases of single values. if (upperBound == -1d) { - upperBound = lowerBound + 50d; - lowerBound = lowerBound - 50d; + upperBound = lowerBound + addValue; + lowerBound = lowerBound - addValue; } return new DoubleRange(lowerBound, upperBound); } diff --git a/zyenyo-discord/src/main/java/dataStructures/InfoCard.java b/zyenyo-discord/src/main/java/dataStructures/InfoCard.java index e981435..c6685d2 100644 --- a/zyenyo-discord/src/main/java/dataStructures/InfoCard.java +++ b/zyenyo-discord/src/main/java/dataStructures/InfoCard.java @@ -163,9 +163,13 @@ public static EmbedBuilder commandNotFound(String command) .addField("Aliases","`tlist`, `tl`", false) .addField("Syntax", "`\\typelist [Options]`", false) .addField("Options", - "`-search | -s:` Specifies a search phrase (Eg: `-s the chandelier`).\n" - + "`-page | -p:` Specifies a page number (Eg: `-p 2`).\n", false) - .addField("Hint", "You can choose your own prompt with `\\tt [prompt number]`", false); + "`-search | -s :` Specifies a search phrase (Eg: `-s the chandelier`).\n" + + "`-page | -p :` Specifies a page number (Eg: `-p 2`).\n" + + "`-typerating | -tr:` Specifies a TR Range to filter the results. You may use `>`, `<`, `-` " + + "for ranges in the following ways: `-tr >1.23` `-tr 0.95-1.3` `-tr 1.2`\n" + + "`-length | -l :` Specifies a character length range to filter the results. You may use `>`, `<`, `-` " + + "for ranges in the following ways: `-l >600` `-l 350-400` `-l 450`\n", false) + .addField("Hint", "You can choose your own prompt with `\\tt [prompt number]`", false); public static final EmbedBuilder TYPING_TOPS = new EmbedBuilder()