Added a network attribute to the Irc object.

This commit is contained in:
Jeremy Fincher 2004-01-28 16:55:08 +00:00
parent 755f2c3564
commit 43c00a3f94
2 changed files with 7 additions and 2 deletions

View File

@ -150,7 +150,8 @@ irclib.Irc:
prefix: The current prefix of the bot.
server: The current server the bot is connected to.
Usually consists of a (host, port) pair.
network: The current network name the bot is connected to.
afterConnect: False until the bot has received a
command sent after the connection is finished --

View File

@ -539,7 +539,11 @@ class Irc(IrcCommandDispatcher):
def do001(self, msg):
"""Does some logging."""
log.info('Received 001 from the server.')
welcome = msg.args[1]
assert welcome.startswith('Welcome to the ')
words = welcome.split()
self.network = words[3].lower()
log.info('Setting network to %s.', self.network)
def do002(self, msg):
"""Logs the ircd version."""