From 14d7b62e11715bf485f54e648ca861caed403c6c Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 15 May 2011 14:02:27 -0400 Subject: [PATCH] sleep before joining and add a mode() function to Connection: thanks DeltaQuad --- irc/connection.py | 4 ++++ irc/frontend.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/irc/connection.py b/irc/connection.py index 09ac25c..87be572 100644 --- a/irc/connection.py +++ b/irc/connection.py @@ -69,3 +69,7 @@ class Connection(object): def join(self, chan): """join a channel""" self.send("JOIN %s" % chan) + + def mode(self, chan, level, msg): + """send a mode message""" + self.send("MODE %s %s %s" % (chan, level, msg)) diff --git a/irc/frontend.py b/irc/frontend.py index 391468f..293bc0a 100644 --- a/irc/frontend.py +++ b/irc/frontend.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ## Imports -import re +import re, time from config.irc import * from config.secure import * @@ -70,5 +70,6 @@ def main(): if line[1] == "376": if NS_AUTH: # if we're supposed to auth to nickserv, do that connection.say("NickServ", "IDENTIFY %s %s" % (NS_USER, NS_PASS)) + time.sleep(3) # sleep for a bit so we don't join channels un-authed for chan in CHANS: # join all of our startup channels connection.join(chan)