Bug resolved: Crashing when receiving not-PRIVMSG messages.
This commit is contained in:
parent
3801384c4e
commit
f361c39b53
35
PagerBot.py
35
PagerBot.py
@ -93,32 +93,29 @@ while 1:
|
|||||||
line=string.rstrip(line)
|
line=string.rstrip(line)
|
||||||
line=string.split(line)
|
line=string.split(line)
|
||||||
|
|
||||||
un=string.split(line[0], "!")
|
|
||||||
un2=string.split(un[0], ":")
|
|
||||||
usernick=un2[1]
|
|
||||||
|
|
||||||
channel=line[2]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(line[0]=="PING"):
|
if(line[0]=="PING"):
|
||||||
ircsock.send("PONG %s\r\n" % line[1])
|
ircsock.send("PONG %s\r\n" % line[1])
|
||||||
|
|
||||||
if(line[1]=="PRIVMSG" and "#" in line[2]):
|
if(line[1]=="PRIVMSG"):
|
||||||
if(line[3] == ":%s:" % (NICK) or line[3] == ":&pager"):
|
un=string.split(line[0], "!")
|
||||||
ircsock.send("PRIVMSG %s %s: I only do stuff via query.\r\n" % (channel, usernick))
|
un2=string.split(un[0], ":")
|
||||||
|
usernick=un2[1]
|
||||||
|
|
||||||
if(line[1]=="PRIVMSG" and "#" not in line[2]):
|
if("#" in line[2]):
|
||||||
if(line[3] == ":help"):
|
if(line[3] == ":%s:" % (NICK) or line[3] == ":&pager"):
|
||||||
ircsock.send("PRIVMSG %s This is a bot to use a paging service.\r\n" % (usernick))
|
ircsock.send("PRIVMSG %s %s: I only do stuff via query.\r\n" % (line[2], usernick))
|
||||||
time.sleep(1)
|
|
||||||
ircsock.send("PRIVMSG %s Use \"/msg %s &pager <Username> <Message>\" to page someone.\r\n" % (usernick, NICK))
|
|
||||||
|
|
||||||
|
if("#" not in line[2]):
|
||||||
elif(line[3] == ":&pager"):
|
if(line[3] == ":help"):
|
||||||
pagingtext=' '.join(line[5:])
|
ircsock.send("PRIVMSG %s This is a bot to use a paging service.\r\n" % (usernick))
|
||||||
print("%s sends to %s \"%s\"\n" % (usernick, line[4], pagingtext))
|
time.sleep(1)
|
||||||
ircsock.send("PRIVMSG %s %s\r\n" % (usernick, page(line[4], pagingtext, usernick)))
|
ircsock.send("PRIVMSG %s Use \"/msg %s &pager <Username> <Message>\" to page someone.\r\n" % (usernick, NICK))
|
||||||
|
elif(line[3] == ":&pager"):
|
||||||
|
pagingtext=' '.join(line[5:])
|
||||||
|
print("%s tries to send to %s \"%s\"\n" % (usernick, line[4], pagingtext))
|
||||||
|
ircsock.send("PRIVMSG %s %s\r\n" % (usernick, page(line[4], pagingtext, usernick)))
|
||||||
|
|
||||||
|
|
||||||
# print(line)
|
# print(line)
|
||||||
|
Loading…
Reference in New Issue
Block a user