diff --git a/src/irc.coffee b/src/irc.coffee index 3e65f68..331f095 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -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? @@ -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