A digital, d-whatever dice roller.
Accepts "dice shorthand", QdS
, where Q
is the quantity of dice, and S
is
the number of sides.
For example, 2d12
will generate 2
random numbers between 1 and 12
(inclusive.)
This utility does not restrict users to standard-sided dice, meaning you can
easily roll percentages (1d100
) or weird-sided dice (32d17
, you know... in case you felt
the need to roll 32
17
-sided dice...)
- Install dependencies with pip:
$ pip install -r requirements.txt
- Set the value of
"SLACK_TOKEN"
in.chalice/config.json
to be some string. Upon deployment, Chalice will set up your slack token as a lambda-accessible environment variable.
Roll is currently set up to deploy as an AWS Lambda with API Gateway, using Chalice.
- Set up your local environment with an AWS config and corresponding credentials.
Note: in my opinion, the official docs I've linked above aren't particularly friendly to newer AWS users, but they're comprehensive, updated regularly, and appear to be improving over time.
- Deploy:
$ chalice deploy
- Serve:
$ chalice local
- POST to the running app using
curl
or Postman or whatever, with aHeader
includingContent-Type: application/x-www-form-urlencoded
and the followingBody
data:
key | value description |
---|---|
token | Some token used to poorly validate the source of the request. This value should match what you've set during Setup NOTE: This will change in the future. |
text | some dice shorthand (described above) |