From fe2a7b8a3c9425545116a8d552dd4d392062e3e1 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Wed, 25 Apr 2012 02:58:41 +1200 Subject: [PATCH] irc.py now keeps track of channels properly --- core/irc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/irc.py b/core/irc.py index 50ff379..8a89af2 100755 --- a/core/irc.py +++ b/core/irc.py @@ -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])