Skip to content

Instantly share code, notes, and snippets.

@kimausloos
Created March 6, 2014 07:29
Show Gist options
  • Select an option

  • Save kimausloos/9384215 to your computer and use it in GitHub Desktop.

Select an option

Save kimausloos/9384215 to your computer and use it in GitHub Desktop.
Hubot slack adaptor
###################################################################
# Communicating back to the chat rooms. These are exposed
# as methods on the argument passed to callbacks from
# robot.respond, robot.listen, etc.
###################################################################
send: (envelope, strings...) ->
@log "Sending message"
channel = envelope.reply_to || envelope.room
strings.forEach (str) =>
str = @escapeHtml str
args = JSON.stringify
username : @robot.name
channel : channel
text : str
link_names : @options.link_names
@post "/services/hooks/hubot", args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment