mirror of https://github.com/Mikaela/Limnoria.git
Added a network attribute to the Irc object.
This commit is contained in:
parent
755f2c3564
commit
43c00a3f94
|
@ -150,7 +150,8 @@ irclib.Irc:
|
||||||
prefix: The current prefix of the bot.
|
prefix: The current prefix of the bot.
|
||||||
|
|
||||||
server: The current server the bot is connected to.
|
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
|
afterConnect: False until the bot has received a
|
||||||
command sent after the connection is finished --
|
command sent after the connection is finished --
|
||||||
|
|
|
@ -539,7 +539,11 @@ class Irc(IrcCommandDispatcher):
|
||||||
|
|
||||||
def do001(self, msg):
|
def do001(self, msg):
|
||||||
"""Does some logging."""
|
"""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):
|
def do002(self, msg):
|
||||||
"""Logs the ircd version."""
|
"""Logs the ircd version."""
|
||||||
|
|
Loading…
Reference in New Issue