Skip to content

Commit

Permalink
append on constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnk committed Mar 20, 2012
1 parent df2a032 commit 68c35fe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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

0 comments on commit 68c35fe

Please sign in to comment.