diff --git a/docs/INTERFACES b/docs/INTERFACES index 24ca6742c..7119d164e 100644 --- a/docs/INTERFACES +++ b/docs/INTERFACES @@ -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 -- diff --git a/src/irclib.py b/src/irclib.py index 01a871358..4d9119db6 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -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."""