Permalink
Browse files

Add send/reply functions to Robot

  • Loading branch information...
1 parent 612e8bd commit 28963b162adcbc75e8409e486f830994c2b24fec Tom Bell committed Nov 24, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/robot.coffee
View
@@ -167,6 +167,22 @@ class Robot
continue if !line.match('-')
@commands.push line[2..line.length]
+ # Public: A helper send function which delegates to the adapter's send
+ # function.
+ #
+ # user - A User instance.
+ # strings - One or more Strings for each message to send.
+ send: (user, strings...) ->
+ @adapter.send user, strings...
+
+ # Public: A helper reply function which delegates to the adapter's reply
+ # function.
+ #
+ # user - A User instance.
+ # strings - One or more Strings for each message to send.
+ reply: (user, strings...) ->
+ @adapter.reply user, strings...
+
# Public: Get an Array of User objects stored in the brain.
users: ->
@brain.data.users

0 comments on commit 28963b1

Please sign in to comment.