 
   # Public: Passes the given message to any interested Listeners.
   #
-  # message - A Robot.Message instance.
+  # message - A Robot.Message instance. Listeners can flag this message as
+  #  'done' to prevent further execution
   #
   # Returns nothing.
   receive: (message) ->
-    for lst in @listeners
-      try
-        lst.call message
-      catch ex
-        @logger.error "Unable to call the listener: #{ex}"
+    for listener in @listeners
+      unless message.done
+        try
+          listener.call message
+        catch ex
+          @logger.error "Unable to call the listener: #{ex}"
+
 
   # Public: Loads every script in the given path.
   #

  # Represents an incoming message from the chat.
  #
  # user - A User instance that sent the message.
  constructor: (@user) ->

class Robot.TextMessage extends Robot.Message
  # Represents an incoming message from the chat.

  #
  # items - An Array of items (usually Strings).
  #
  # Returns an random item.
  random: (items) ->
    items[ Math.floor(Math.random() * items.length) ]

  # Public: Tell the message to stop dispatching to listeners
  #
  # Returns nothing.
  finish: () ->
    @message.finish()

  # Public: Creates a scoped http client with chainable methods for
  # modifying the request.  This doesn't actually make a request though.
