strinking / mawabot

A Discord selfbot to do tasks
MIT License
4 stars 2 forks source link

Have .roll accept multiple dice rolls #32

Open emmiegit opened 7 years ago

emmiegit commented 7 years ago

So right now .roll only accepts one dice roll configuration. It should be able to support any number of configurations, such as:

.roll 2d20 d6
emmiegit commented 6 years ago

I'll attach it to this issue, but also add offsets to dice rolls. So like, 3d6+2 rolls a d6, but adds 2 to the result, making it do 3 rolls in the range [2, 8]. The regex for the new dice roll should be something like:

(?:([0-9]+)?[dD])?([0-9]+)(?:([+-][0-9]+))?
raylu-stripe commented 6 years ago

so... https://github.com/raylu/sbot/blob/master/utils.py#L24 supports advantage, exploding dice, arithmetic, etc.