Skip to content

Commit

Permalink
Added option to execute additional command after connecting
Browse files Browse the repository at this point in the history
  • Loading branch information
dy-dx committed Mar 7, 2013
1 parent 9468c79 commit 9a140ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class IrcBot extends Adapter
password: process.env.HUBOT_IRC_PASSWORD
nickpass: process.env.HUBOT_IRC_NICKSERV_PASSWORD
nickusername: process.env.HUBOT_IRC_NICKSERV_USERNAME
connectCommand: process.env.HUBOT_IRC_CONNECT_COMMAND
fakessl: process.env.HUBOT_IRC_SERVER_FAKE_SSL?
certExpired: process.env.HUBOT_IRC_SERVER_CERT_EXPIRED?
unflood: process.env.HUBOT_IRC_UNFLOOD?
Expand Down Expand Up @@ -161,6 +162,12 @@ class IrcBot extends Adapter
for room in options.rooms
@join room

if options.connectCommand?
bot.addListener 'registered', (message) ->
# The 'registered' event is fired when you are connected to the server
strings = options.connectCommand.split " "
self.command strings.shift(), strings...

bot.addListener 'names', (channel, nicks) ->
for nick of nicks
self.createUser channel, nick
Expand Down

0 comments on commit 9a140ff

Please sign in to comment.