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': if ny('Does that server require connection on a non-standard port?')=='y':
server = ':'.join(server, anything('What port is that?')) server = ':'.join(server, anything('What port is that?'))
configfd.write('Server: %s\n' % server) 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?') nick = anything('What nick would you like the bot to use?')
configfd.write('Nick: %s\n' % nick) configfd.write('Nick: %s\n' % nick)
if advanced and ny('Would you like to set a user/ident?') == 'y': if advanced and ny('Would you like to set a user/ident?') == 'y':

View File

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