From abd4bca21bc907ad186c2395181e583f1fe728aa Mon Sep 17 00:00:00 2001 From: Hung IRC Bot Date: Sun, 27 May 2012 18:03:28 +0200 Subject: [PATCH] Plantait si on lui proposait un mot en dehors d'une partie --- hung.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hung.py b/hung.py index 30278ea..c96f834 100755 --- a/hung.py +++ b/hung.py @@ -122,7 +122,7 @@ class Hung(ircbot.SingleServerIRCBot): self.chanlist=config_chanlist self.stay_channels=config_stay_channels self.play_channels=config_play_channels - self.play_status={} + self.play_status={i:[None,None,None] for i in self.play_channels} self.quiet_channels=config_quiet_channels @@ -405,7 +405,7 @@ class Hung(ircbot.SingleServerIRCBot): serv.privmsg(canal,"%s: %s"%(auteur,ligne.encode("utf8"))) # on essaye de voir si le mot fourni matche la partie en cours mot = cmd - if is_mot(mot, self.play_status[canal][0]): + if self.play_status[canal][0]!=None and is_mot(mot, self.play_status[canal][0]): # on a trouvé le mot # on regarde combien de lettre il manquait manquait = sum([not lettre[1] for lettre in self.play_status[canal][0]]) -- 2.39.2