From 68c35fe0c0a17b57064d1e61b5cfb9dfdb1541ec Mon Sep 17 00:00:00 2001 From: kmnk Date: Tue, 20 Mar 2012 14:02:50 +0900 Subject: [PATCH] append on constructor --- src/irc.coffee | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/irc.coffee b/src/irc.coffee index ba15476..8ff65b2 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -4,6 +4,14 @@ Adapter = require('hubot').adapter() Irc = require 'irc' class IrcBot extends Adapter + constructor: (@robot) -> + super @robot + + @robot.notice = (user, strings...) -> + @adapter.notice user, strings... + + @robot.Response = IrcResponse + send: (user, strings...) -> for str in strings if not str? @@ -124,10 +132,5 @@ class IrcResponse extends Robot.Response @robot.adapter.notice @message.user, strings... exports.use = (robot) -> - robot.notice = (user, strings...) -> - @adapter.notice user, strings... - - robot.Response = IrcResponse - new IrcBot robot