Skip to content

Commit

Permalink
Fix #100;Fix #108;
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksgata committed Sep 14, 2022
1 parent acb9e23 commit fc205b9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ public String roll(MessageData<?> data) {
if (diceFace != null) {
diceSet.setDiceFace(data.getQqID(), diceFace);
}
if (data.getMessage().equals("") || data.getMessage().equals(" ")) {
if (data.getMessage().equals("") || data.getMessage().equals(" ") || data.getMessage().equals("d") || data.getMessage().equals("D")) {
return rollBasics.rollRandom("d", data.getQqID());
} else {
//正则筛选
String result = RegularExpressionUtils.getMatcher("[0-9dD+\\-*/+-×÷]+", data.getMessage());
String result = RegularExpressionUtils.getMatcher("[0-9]?[dD]?[0-9]{1,5}([\\+\\-\\*\\/][0-9]?[dD]?[0-9]{1,5})*", data.getMessage());
if (result != null) {
return rollBasics.rollRandom(result, data.getQqID()) + data.getMessage().replace(result, "");
}
return rollBasics.rollRandom(data.getMessage(), data.getQqID());
return CustomText.getText("dice.base.parameter.error");
}
}

Expand Down

0 comments on commit fc205b9

Please sign in to comment.