From 9a140ff7484ebd5cb7fa5ac6f6ec1c538915f838 Mon Sep 17 00:00:00 2001 From: Christopher Kim Date: Thu, 7 Mar 2013 13:49:48 -0500 Subject: [PATCH] Added option to execute additional command after connecting --- src/irc.coffee | 7 +++++++ 1 file changed, 7 insertions(+) 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