From a8353b62839ca891a6e6989556d17a89a9ce1e13 Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Wed, 21 Jan 2015 18:10:30 +0200 Subject: [PATCH] Rejoin on invite, by FireFly --- README | 5 +++++ ircbot.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..fc7c018 --- /dev/null +++ b/README @@ -0,0 +1,5 @@ +Not that ugly IRC bot. In fact, ircbot.py is quite nice. + +Contributions +------------- +* FireFly: Join back to auto-join channels on /invite diff --git a/ircbot.py b/ircbot.py index cd127ff..d4513ed 100755 --- a/ircbot.py +++ b/ircbot.py @@ -43,8 +43,14 @@ class Connhandler(threading.Thread): if s.split(' ')[0]!='PONG': self.logc.send(s+'\n') def check(self,line): - if line.split(' ')[0]=='PING': + args=line.split(' ') + nick=args[0].split('!')[0][1:] + chan=args[2] if len(args) >= 3 and args[2][0]=='#' else nick + if args[0]=='PING': self.send('PONG :hjdicks') + elif args[1]=='INVITE' and args[2]==self.nick and args[3][1:] in self.chan.split(' '): + botcmd.addauthcmd(nick, 'JOIN '+args[3]) + self.send('PRIVMSG NickServ :ACC '+nick) else: self.logc.send(line+'\n') Threadwrapper(botcmd.parse,(line,self.inpc)).start()