Http triggered AWS Step Functions for decision making, which can be integrated with slack commands.
- Go to your slack team, and choose
Customize Your Team
->Emoji
. - Create the following emojis for dices. Related gifs can be found here.
- dice_1
- dice_2
- dice_3
- dice_4
- dice_5
- dice_6
- Create the following emojis for coins, apparently for two sides of coins.
- coin_1
- coin_2
-
Install the AWS CLI for your operating system.
-
Configure your AWS security access keys
aws --profile decisionmaker configure AWS Access Key ID [None]: xxxxxxxxxxxxxxxx AWS Secret Access Key [None]: xxxxxxxxxxxxxxxxxxxx Default region name [None]: ap-southeast-2 Default output format [None]: json
-
Activate the decision-maker profile
export AWS_PROFILE=decision-maker
-
Deploy the project by running the following commands:
git clone https://github.com/jaypeng2015/decision-maker cd decision-maker npm i npm run deploy
-
Remember the endpoint shows in the result.
- Go to your slack team,
Custom Integrations
->Slash Command
and then create a new command. - Choose a command name, normally
/roll
- Enter the API gateway endpoint as
URL
- Customize other fields as you want
- /roll (same as /roll dice)
- /roll coin
- /roll 100 (or any numbers)