Skip to content

Commit a54b89d

Browse files
committedJun 25, 2012
Updating to work with latest hubot.
1 parent 4b39ced commit a54b89d

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed
 

‎src/irc.coffee

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
Robot = require('hubot').robot()
2-
Adapter = require('hubot').adapter()
1+
Robot = require('hubot').Robot
2+
Adapter = require('hubot').Adapter
3+
TextMessage = require('hubot').TextMessage
34

45
Irc = require 'irc'
56

67
class IrcBot extends Adapter
7-
constructor: (@robot) ->
8-
super @robot
9-
10-
@robot.notice = (user, strings...) ->
11-
@adapter.notice user, strings...
12-
13-
@robot.Response = IrcResponse
14-
158
send: (user, strings...) ->
169
for str in strings
1710
if not str?
@@ -48,6 +41,12 @@ class IrcBot extends Adapter
4841
@bot.part channel, () ->
4942
console.log('left %s', channel)
5043

44+
kick: (channel, client, message) ->
45+
@bot.emit 'raw',
46+
command: 'KICK'
47+
nick: process.env.HUBOT_IRC_NICK
48+
args: [ channel, client, message ]
49+
5150
command: (command, strings...) ->
5251
@bot.send command, strings...
5352

@@ -110,7 +109,7 @@ class IrcBot extends Adapter
110109
user.room = null
111110
console.log "msg <#{from}> #{message}"
112111

113-
self.receive new Robot.TextMessage(user, message)
112+
self.receive new TextMessage(user, message)
114113

115114
bot.addListener 'error', (message) ->
116115
console.error('ERROR: %s: %s', message.command, message.args.join(' '))
@@ -135,7 +134,7 @@ class IrcBot extends Adapter
135134

136135
self.emit "connected"
137136

138-
class IrcResponse extends Robot.Response
137+
class IrcResponse extends Response
139138
notice: (strings...) ->
140139
@robot.adapter.notice @message.user, strings...
141140

0 commit comments

Comments
 (0)