checks newList before creating new newcomber obj

This commit is contained in:
Shauna 2014-01-11 10:30:43 -05:00
parent 865113a4cb
commit 603c054072
2 changed files with 47 additions and 2 deletions

7
bot.py
View File

@ -10,7 +10,7 @@ from threading import Thread
server = "irc.freenode.net"
channel = "#openhatch"
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
class newcomer(object): # Newcomer class created when someone joins the room
@ -91,6 +91,7 @@ while 1: # Loop forever
welcome(i.nick)
i.updateStatus()
addPerson(i.nick)
newList.remove(i)
if q.empty() == 0:
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.
i.updateStatus() # Sets status to 1
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?
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 not in nickArray:
newList.append(newcomer(actor))
if actor not in (i.nick for i in newList):
newList.append(newcomer(actor))
# Unwelcome functions
if ircmsg.find(botnick) != -1 and ircmsg.find("PRIVMSG #") != -1: # If someone talks to (or refers to) the bot

View File

@ -2,3 +2,45 @@ paulproteus
britta
aldeka
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

1 paulproteus
2 britta
3 aldeka
4 shauna
5 ArcTanSusan
6 aeva
7 daveeloo2
8 ehashman
9 exor674
10 glyph
11 GorillaWarfare
12 gregglind
13 IShadowed
14 JasonWoof
15 jdunck
16 jeremyb
17 jesstess_
18 johnmorr
19 judytuna
20 keturn
21 klange
22 kxra
23 Kyzz[Mobile]
24 lfaraone
25 mandarg
26 marktraceur
27 mchua
28 mindspillage
29 mlinksva
30 openhatch_hudson
31 paroneayea
32 paulproteus|mobi
33 paultag
34 ptone
35 ptressel
36 pyrak
37 pythonian4000
38 rmo
39 skay
40 sunu
41 ThomasWaldmann
42 Triskelios
43 wolftune
44 Rsouthee
45 rihnapstor
46 fijal