Skip to content

Commit 3cac371

Browse files
committed
Merge pull request nandub#40 from jamesob/nickserv_username
Optional username for NickServ `identify`
2 parents 30b87df + 49dafb5 commit 3cac371

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/irc.coffee

+10-2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class IrcBot extends Adapter
9393
server: process.env.HUBOT_IRC_SERVER
9494
password: process.env.HUBOT_IRC_PASSWORD
9595
nickpass: process.env.HUBOT_IRC_NICKSERV_PASSWORD
96+
nickusername: process.env.HUBOT_IRC_NICKSERV_USERNAME
9697
fakessl: process.env.HUBOT_IRC_SERVER_FAKE_SSL?
9798
unflood: process.env.HUBOT_IRC_UNFLOOD?
9899
debug: process.env.HUBOT_IRC_DEBUG?
@@ -118,9 +119,16 @@ class IrcBot extends Adapter
118119
user_id = {}
119120

120121
if options.nickpass?
122+
identify_args = ""
123+
124+
if options.nickusername?
125+
identify_args += "#{options.nickusername} "
126+
127+
identify_args += "#{options.nickpass}"
128+
121129
bot.addListener 'notice', (from, to, text) ->
122-
if from is 'NickServ' and text.indexOf('registered') isnt -1
123-
bot.say 'NickServ', "identify #{options.nickpass}"
130+
if from is 'NickServ' and text.indexOf('identify') isnt -1
131+
bot.say 'NickServ', "identify #{identify_args}"
124132
else if options.nickpass and from is 'NickServ' and
125133
(text.indexOf('Password accepted') isnt -1 or
126134
text.indexOf('identified') isnt -1)

0 commit comments

Comments
 (0)