Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
Last active August 29, 2015 14:24
Show Gist options
  • Save dhrrgn/bfd9c890161bf10c25f3 to your computer and use it in GitHub Desktop.
Save dhrrgn/bfd9c890161bf10c25f3 to your computer and use it in GitHub Desktop.
# Usage: @HAL tombstone First Line / Second Line / Third Line / Fourth Line
module.exports = (robot) ->
robot.respond /tombstone (.*)/i, (res) ->
lines = res.match[1].split '/'
if lines.length > 4:
res.reply "Too many lines. Max 4."
else
query = for i, line of lines
"top#{parseInt(i)+1}=#{encodeURIComponent(line)}"
res.reply "http://www.tombstonebuilder.com/generate.php?#{query.join('&')}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment