beanc16 / roll-of-darkness-bot

A discord bot for rolling dice in the New World of Darkness, Pokemon Tabletop United, and Curseborne tabletop systems
1 stars 0 forks source link

`/roll_lite` does not handle invalid letters for dicepool gracefully #5

Open beanc16 opened 1 day ago

beanc16 commented 1 day ago

Context

/roll_lite accepts letters, numbers, +'s, and -'s as input, with the intent of allowing users to easily add and subtract various dicepools together. However, we currently don't handle any letters that arent the letter "d" gracefully, leading to strange responses.

Repro Steps

Call /roll_lite dice_pool:2da (note the "a" as an invalid input).

Expected Result

The bot throws a helpful error noting the invalid input.

Actual Result

The dice still roll, with the bot's best guess at the number of dice and sides of the dice to be rolling.

The below screenshot shows the result of:

  1. /roll_lite dice_pool: 2da
  2. /roll_lite dice_pool: ad4 image