irc.py now keeps track of channels properly

This commit is contained in:
Luke Rogers 2012-04-25 02:58:41 +12:00
parent 4538b67a20
commit fe2a7b8a3c

View file

@ -184,9 +184,13 @@ class IRC(object):
def join(self, channel):
self.cmd("JOIN", [channel])
if channel not in self.channels:
self.channels.append(channel)
def part(self, channel):
self.cmd("PART", [channel])
if channel in self.channels:
self.channels.remove(channel)
def msg(self, target, text):
self.cmd("PRIVMSG", [target, text])