checks newList before creating new newcomber obj
This commit is contained in:
parent
865113a4cb
commit
603c054072
7
bot.py
7
bot.py
|
@ -10,7 +10,7 @@ from threading import Thread
|
||||||
server = "irc.freenode.net"
|
server = "irc.freenode.net"
|
||||||
channel = "#openhatch"
|
channel = "#openhatch"
|
||||||
botnick = "WelcomeBot"
|
botnick = "WelcomeBot"
|
||||||
waitTime = 5 # Amount of time after joining before bot replies to someone
|
waitTime = 60 # Amount of time after joining before bot replies to someone
|
||||||
|
|
||||||
# Classes
|
# Classes
|
||||||
class newcomer(object): # Newcomer class created when someone joins the room
|
class newcomer(object): # Newcomer class created when someone joins the room
|
||||||
|
@ -91,6 +91,7 @@ while 1: # Loop forever
|
||||||
welcome(i.nick)
|
welcome(i.nick)
|
||||||
i.updateStatus()
|
i.updateStatus()
|
||||||
addPerson(i.nick)
|
addPerson(i.nick)
|
||||||
|
newList.remove(i)
|
||||||
|
|
||||||
if q.empty() == 0:
|
if q.empty() == 0:
|
||||||
ircmsg = q.get()
|
ircmsg = q.get()
|
||||||
|
@ -102,12 +103,14 @@ while 1: # Loop forever
|
||||||
if actor != i.nick: # Don't turn off response if the person speaking is the person who joined.
|
if actor != i.nick: # Don't turn off response if the person speaking is the person who joined.
|
||||||
i.updateStatus() # Sets status to 1
|
i.updateStatus() # Sets status to 1
|
||||||
addPerson(i.nick)
|
addPerson(i.nick)
|
||||||
|
newList.remove(i)
|
||||||
## Else: Do we want to do something extra if the person who joined the chat says something with no response?
|
## Else: Do we want to do something extra if the person who joined the chat says something with no response?
|
||||||
|
|
||||||
if ircmsg.find("JOIN "+ channel) != -1: # If someone joins #channel
|
if ircmsg.find("JOIN "+ channel) != -1: # If someone joins #channel
|
||||||
if actor != botnick: # Remove the case where the bot gets a message that the bot has joined.
|
if actor != botnick: # Remove the case where the bot gets a message that the bot has joined.
|
||||||
if actor not in nickArray:
|
if actor not in nickArray:
|
||||||
newList.append(newcomer(actor))
|
if actor not in (i.nick for i in newList):
|
||||||
|
newList.append(newcomer(actor))
|
||||||
|
|
||||||
# Unwelcome functions
|
# Unwelcome functions
|
||||||
if ircmsg.find(botnick) != -1 and ircmsg.find("PRIVMSG #") != -1: # If someone talks to (or refers to) the bot
|
if ircmsg.find(botnick) != -1 and ircmsg.find("PRIVMSG #") != -1: # If someone talks to (or refers to) the bot
|
||||||
|
|
42
nicks.csv
42
nicks.csv
|
@ -2,3 +2,45 @@ paulproteus
|
||||||
britta
|
britta
|
||||||
aldeka
|
aldeka
|
||||||
shauna
|
shauna
|
||||||
|
ArcTanSusan
|
||||||
|
aeva
|
||||||
|
daveeloo2
|
||||||
|
ehashman
|
||||||
|
exor674
|
||||||
|
glyph
|
||||||
|
GorillaWarfare
|
||||||
|
gregglind
|
||||||
|
IShadowed
|
||||||
|
JasonWoof
|
||||||
|
jdunck
|
||||||
|
jeremyb
|
||||||
|
jesstess_
|
||||||
|
johnmorr
|
||||||
|
judytuna
|
||||||
|
keturn
|
||||||
|
klange
|
||||||
|
kxra
|
||||||
|
Kyzz[Mobile]
|
||||||
|
lfaraone
|
||||||
|
mandarg
|
||||||
|
marktraceur
|
||||||
|
mchua
|
||||||
|
mindspillage
|
||||||
|
mlinksva
|
||||||
|
openhatch_hudson
|
||||||
|
paroneayea
|
||||||
|
paulproteus|mobi
|
||||||
|
paultag
|
||||||
|
ptone
|
||||||
|
ptressel
|
||||||
|
pyrak
|
||||||
|
pythonian4000
|
||||||
|
rmo
|
||||||
|
skay
|
||||||
|
sunu
|
||||||
|
ThomasWaldmann
|
||||||
|
Triskelios
|
||||||
|
wolftune
|
||||||
|
Rsouthee
|
||||||
|
rihnapstor
|
||||||
|
fijal
|
||||||
|
|
|
Loading…
Reference in New Issue