Skip to content
This repository
Browse code

Add send/reply functions to Robot

  • Loading branch information...
commit 28963b162adcbc75e8409e486f830994c2b24fec 1 parent 612e8bd
Tom Bell tombell authored

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. +16 0 src/robot.coffee
16 src/robot.coffee
@@ -167,6 +167,22 @@ class Robot
167 167 continue if !line.match('-')
168 168 @commands.push line[2..line.length]
169 169
  170 + # Public: A helper send function which delegates to the adapter's send
  171 + # function.
  172 + #
  173 + # user - A User instance.
  174 + # strings - One or more Strings for each message to send.
  175 + send: (user, strings...) ->
  176 + @adapter.send user, strings...
  177 +
  178 + # Public: A helper reply function which delegates to the adapter's reply
  179 + # function.
  180 + #
  181 + # user - A User instance.
  182 + # strings - One or more Strings for each message to send.
  183 + reply: (user, strings...) ->
  184 + @adapter.reply user, strings...
  185 +
170 186 # Public: Get an Array of User objects stored in the brain.
171 187 users: ->
172 188 @brain.data.users

0 comments on commit 28963b1

Please sign in to comment.
Something went wrong with that request. Please try again.