Create a gist now

Instantly share code, notes, and snippets.

# Receive a fortune
# fortune me - Returns a random fortune
HTTP = require "http"
module.exports = (robot) ->
robot.hear /fortune( me)?/i, (response) ->
opt = { method: "GET", host: "", path: "/random" }
req = HTTP.request opt, (res) ->
response.send res.body["fortune"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment