Skip to content
Browse files

Add bot shutdown function

  • Loading branch information...
1 parent ec5a335 commit 44dd87eed959d61eca644723143e633b5c915be4 @alexwhitman alexwhitman committed Nov 27, 2011
Showing with 5 additions and 0 deletions.
  1. +1 −0 src/adapters/shell.coffee
  2. +4 −0 src/robot.coffee
View
1 src/adapters/shell.coffee
@@ -25,6 +25,7 @@ class Shell extends Adapter
@repl.on "close", =>
stdin.destroy()
+ @robot.shutdown()
process.exit 0
@repl.on "line", (buffer) =>
View
4 src/robot.coffee
@@ -230,6 +230,10 @@ class Robot
run: ->
@adapter.run()
+ shutdown: ->
+ @adapter.close()
+ @brain.close()
+
class Robot.Message
# Represents an incoming message from the chat.
#

0 comments on commit 44dd87e

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