commit 9bf0efd65b2dc095d7fee40a6aebfa95fd1c0599
parent 0daa0254d05891d39c58b033310b05693719cefd
Author: Antoine Amarilli <ant.amarilli@free.fr>
Date: Fri, 20 May 2011 17:44:04 -0400
don't welcome unknown users
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/snipe.py b/snipe.py
@@ -146,16 +146,15 @@ if ok:
try:
while True:
- line = sys.stdin.readline()
+ try:
+ line = sys.stdin.readline()
+ except UnicodeDecodeError:
+ continue
if (not line):
break
chan, speaker, message, to_us = parse(line)
if speaker not in list(game.keys()):
game[speaker] = Player(speaker)
- game[speaker].welcome()
- if message != "help":
- say_to(speaker, speaker, help)
- game[speaker].report()
if to_us:
if message == "help":
say_to(chan, speaker, help)
@@ -178,6 +177,7 @@ try:
words = split(message)
todo = []
for word in words:
+ word = word.lower()
for player in game.values():
if player.name != speaker:
score = player.succeed(word)