forked from Firepup650/FireBot
Fixing loopholes
This commit is contained in:
parent
69d601042e
commit
a45581bb0a
1 changed files with 8 additions and 8 deletions
12
ircbot.py
12
ircbot.py
|
@ -257,7 +257,7 @@ def op(name, chan):
|
|||
|
||||
def main():
|
||||
try:
|
||||
global ircmsg, channels, e, gmode, prefix, rebt, gblrebt, lrebt, lgblrebt, blanks
|
||||
global channels, e, gmode, prefix, rebt, gblrebt, lrebt, lgblrebt, blanks
|
||||
log("Starting connection..", server)
|
||||
joinserver()
|
||||
if "pass" in servers[server]:
|
||||
|
@ -266,19 +266,19 @@ def main():
|
|||
for chan in channels:
|
||||
joinchan(chan, "null", channels, False)
|
||||
while 1:
|
||||
global ircmsg, gmode
|
||||
global gmode
|
||||
raw = recv()
|
||||
ircmsg = raw.decode()
|
||||
if ircmsg == "":
|
||||
exit("Probably a netsplit")
|
||||
else:
|
||||
print(raw.lazy_decode(), sep="\n")
|
||||
if ircmsg.find("PRIVMSG") != -1:
|
||||
action = "Unknown"
|
||||
try:
|
||||
ircmsg.split("PRIVMSG", 1)[1]
|
||||
action = ircmsg.split(" ", 2)[1].strip()
|
||||
except IndexError:
|
||||
log("Fake message recieved", server, "WARN")
|
||||
continue
|
||||
pass
|
||||
if action == "PRIVMSG":
|
||||
# Format of ":[Nick]![ident]@[host|vhost] PRIVMSG [channel] :[message]”
|
||||
name = ircmsg.split("!", 1)[0][1:]
|
||||
helpErr = False
|
||||
|
|
Loading…
Reference in a new issue