does not greet nicks who leave quickly
This commit is contained in:
parent
32812dd656
commit
c3f6f90c33
7
bot.py
7
bot.py
|
@ -57,12 +57,10 @@ def makeNickArray(): # On startup, makes array of nicks from Nicks.txt. New in
|
|||
for row in nicksData:
|
||||
nickArray.append(row)
|
||||
return nickArray
|
||||
# Do I need to explicitly close this file?
|
||||
|
||||
def addPerson(person): # Adds newcomer to list of known nicks
|
||||
person = person.replace("_","")
|
||||
nickArray.append([person])
|
||||
print nickArray
|
||||
with open('nicks.csv', 'a') as csvfile:
|
||||
nickwriter = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
|
||||
nickwriter.writerow([person])
|
||||
|
@ -114,6 +112,11 @@ while 1: # Loop forever
|
|||
if actor not in (i.nick for i in newList):
|
||||
newList.append(newcomer(actor))
|
||||
|
||||
if ircmsg.find("PART " + channel) != -1 or ircmsg.find("QUIT") != -1: # If someone parts or quits the #channel
|
||||
for i in newList: # And that person is on the newlist (has entered channel within last 60 seconds)
|
||||
if actor == i.nick:
|
||||
newList.remove(i) # Remove them from the list
|
||||
|
||||
# Unwelcome functions
|
||||
if ircmsg.find(botnick) != -1 and ircmsg.find("PRIVMSG") != -1: # If someone talks to (or refers to) the bot
|
||||
chan = channel
|
||||
|
|
Loading…
Reference in New Issue