github.com/iron-io/functions@v0.0.0-20180820112432-d59d7d1c40b2/examples/slackbot/guppy/README.md (about) 1 ## Quick Example for a SlackBot command in Ruby 2 3 This example will show you how to test and deploy a SlackBot command to IronFunctions. 4 5 ```sh 6 # create your func.yaml file 7 fn init <YOUR_DOCKERHUB_USERNAME>/guppy 8 # build the function - install dependencies from json gem 9 fn build 10 # test it 11 cat slack.payload | fn run 12 # push it to Docker Hub 13 fn push 14 # Create a route to this function on IronFunctions 15 fn routes create slackbot /guppy 16 # Change the route response header content-type to application/json 17 fn routes headers set slackbot /guppy Content-Type application/json 18 # test it remotely 19 cat slack.payload | fn call slackbot /guppy 20 ``` 21 22 ## Create a Slash Command integration in Slack 23 24 In Slack, go to Integrations, find Slash Commands, click Add, type in / as the command then click Add again. On the next page, take the IronFunctions route URL and paste it into the URL field then click Save Integration. 25 26 If running in localhost, use [ngrok](https://github.com/inconshreveable/ngrok). 27 28 # Try it out! 29 30 In slack, type /<COMMAND> [options] and you'll see the magic! 31 32