Skip to content

Commit

Permalink
Added help entry and incremented version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Seizoxu committed Jan 5, 2024
1 parent 28b1281 commit dd658e8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion zyenyo-discord/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.seizoxu.zyenyo</groupId>
<artifactId>zyenyo</artifactId>
<version>0.3.06-beta</version>
<version>0.3.07-beta</version>
<name>ZyenyoBot</name>

<properties>
Expand Down
11 changes: 6 additions & 5 deletions zyenyo-discord/src/main/java/asynchronous/typing/TypeList.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();}
Expand All @@ -136,7 +136,7 @@ private void parseArguments()
lengthString += args[j];
}

trRange = parseRange(lengthString);
trRange = parseRange(lengthString, false);
}
catch(NumberFormatException e) {e.printStackTrace();}
break;
Expand All @@ -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);

Expand All @@ -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);
}
Expand Down
10 changes: 7 additions & 3 deletions zyenyo-discord/src/main/java/dataStructures/InfoCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dd658e8

Please sign in to comment.