Added more support for passworded servers.

This commit is contained in:
Jeremy Fincher 2003-04-07 03:45:05 +00:00
parent 16374c53d6
commit 6e0aff9fb2
2 changed files with 5 additions and 1 deletions

View File

@ -74,6 +74,9 @@ if __name__ == '__main__':
if ny('Does that server require connection on a non-standard port?')=='y':
server = ':'.join(server, anything('What port is that?'))
configfd.write('Server: %s\n' % server)
if ny('Does the server require a password to connect?') == 'y':
password = anything('What password would you like the bot to use?')
configfd.write('Pass: ' + password)
nick = anything('What nick would you like the bot to use?')
configfd.write('Nick: %s\n' % nick)
if advanced and ny('Would you like to set a user/ident?') == 'y':

View File

@ -103,6 +103,7 @@ def processConfigFile(filename):
return
nick = d['nick']
server = d['server']
password = d['password']
if server.find(':') != -1:
(server, port) = server.split(':', 1)
try:
@ -114,7 +115,7 @@ def processConfigFile(filename):
server = (server, 6667)
user = d['user'] or nick
ident = d['ident'] or nick
irc = irclib.Irc(nick, user, ident)
irc = irclib.Irc(nick, user, ident, password)
for Class in privmsgs.standardPrivmsgModules:
irc.addCallback(Class())
world.startup = True