Moved join-on-invite to botcmd.py, unbroke the API
This commit is contained in:
parent
64c7f8165b
commit
ddc026907a
3 changed files with 4 additions and 6 deletions
2
README
2
README
|
@ -2,4 +2,4 @@ Not that ugly IRC bot. In fact, ircbot.py is quite nice.
|
||||||
|
|
||||||
Contributions
|
Contributions
|
||||||
-------------
|
-------------
|
||||||
* FireFly: Join back to auto-join channels on /invite
|
* FireFly: Join back to auto-join channels on /invite (original)
|
||||||
|
|
|
@ -236,6 +236,9 @@ def parse((line,irc)):
|
||||||
irc.msg(line[3][1:], 'WTF, NickServ returned %s'+line[5])
|
irc.msg(line[3][1:], 'WTF, NickServ returned %s'+line[5])
|
||||||
authcmdlock.release()
|
authcmdlock.release()
|
||||||
authfunclock.release()
|
authfunclock.release()
|
||||||
|
elif line[1]=='INVITE' and line[2]==irc.nick and line[3][1:] in irc.chan.split(' '):
|
||||||
|
addauthcmd(nick, 'JOIN '+line[3])
|
||||||
|
irc.msg('NickServ', 'ACC '+nick)
|
||||||
elif line[1]=='482':
|
elif line[1]=='482':
|
||||||
irc.msg(line[3], 'Not op')
|
irc.msg(line[3], 'Not op')
|
||||||
#elif line[1]=='332' or line[1]=='TOPIC':
|
#elif line[1]=='332' or line[1]=='TOPIC':
|
||||||
|
|
|
@ -59,13 +59,8 @@ class Connhandler(threading.Thread):
|
||||||
self.logc.send(s+'\n')
|
self.logc.send(s+'\n')
|
||||||
def check(self,line):
|
def check(self,line):
|
||||||
args=line.split(' ')
|
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':
|
if args[0]=='PING':
|
||||||
self.send('PONG :hjdicks')
|
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:
|
else:
|
||||||
self.logc.send(line+'\n')
|
self.logc.send(line+'\n')
|
||||||
Threadwrapper(botcmd.parse,(line,Irc(self.chan, self.nick, self.inpc))).start()
|
Threadwrapper(botcmd.parse,(line,Irc(self.chan, self.nick, self.inpc))).start()
|
||||||
|
|
Loading…
Reference in a new issue