From 58a13717787314c75874b8c1b1b3b7bb953cf293 Mon Sep 17 00:00:00 2001 From: Thomas Coppi Date: Fri, 27 Apr 2007 11:51:56 -0600 Subject: [PATCH] Check if channels are valid before joining --- scrappy.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scrappy.py b/scrappy.py index c5f7f7c..666ffbd 100755 --- a/scrappy.py +++ b/scrappy.py @@ -8,8 +8,9 @@ import sys #Event Handlers# ################ def on_connect(c,event): - if(irclib_scrappy.is_channel(target)): - c.join(target) + for ch in sys.argv[3:]: + if(irclib_scrappy.is_channel('#%s' % ch)): + c.join('#%s' % ch) def on_privmsg(c,event): print "OMG I GOT A MSG!!one!\n" @@ -37,7 +38,6 @@ if(__name__ == "__main__"): port = 6667 nickname = sys.argv[2] - target = sys.argv[3] irc = irclib_scrappy.IRC() @@ -50,7 +50,6 @@ if(__name__ == "__main__"): c.add_global_handler("welcome", on_connect) c.add_global_handler("disconnect", on_disconnect) c.add_global_handler("privmsg", on_privmsg) - for ch in sys.argv[3:]: - c.join('#%s' % ch) + irc.process_forever() -- 2.11.4.GIT