ASU-CodeDevils / flameboi-slack-api

A Slackbot API for the old CodeDevils Slack server.
https://asu-codedevils.github.io/flameboi-slack-api/
MIT License
4 stars 0 forks source link

Add ability to role multiple die at once #11

Open bananabrann opened 4 years ago

bananabrann commented 4 years ago

Add a second parameter to the roll command that allows multiple dice of a given amount to be rolled. Example:

/roll 2 20 would roll two d20s, and should result in something like "12, 15, total: 27". Users should also be able to do /roll 1d20 2d6 where the result would be something like 19, 4, 3, total: 26

My thought process against using is tuples, or any other form of parenthesis or markup in calling the function (ex: /roll (1,"d20"), (2, "d6") ), is that the goal is to be user-friendly. Three extra lines of code to interpret the user input saves countless minutes of users typing.

stucamp commented 4 years ago

There is a basic dice.py file in the commands directory that can be used to build off of. Ultimately, I'd like to develop a system of keeping each additional features modular so essentially people can just write a feature module that can then be incorporated into the main bot by simply adding a phrase to listen for in the handler. That said we'll have to develop some guidlines as to the return types/etc that will be expected...

bananabrann commented 4 years ago

I'll play around with it tomorrow!

stucamp commented 4 years ago

Moved to in progress given there's a base file written and @bananabrann gonna take a peek.

bananabrann commented 4 years ago

Not currently working on this due to life.