From: Hung IRC Bot Date: Sun, 27 May 2012 16:03:28 +0000 (+0200) Subject: Plantait si on lui proposait un mot en dehors d'une partie X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fhung.git;a=commitdiff_plain;h=abd4bca21bc907ad186c2395181e583f1fe728aa;ds=sidebyside Plantait si on lui proposait un mot en dehors d'une partie --- 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]])