diff --git a/nardco.py b/nardco.py index d1548a1e1ffda2d763865d917f76e590aa327118..00901c1b743ceebc4c76fc998a2a8ece5d9153a4 100755 --- a/nardco.py +++ b/nardco.py @@ -58,6 +58,8 @@ cmdCarac = "$" personnalizedCmd = {} reponse = None +pas_reponse = [] +a_repondu = [] def isCommande(string): global cmdCarac @@ -133,6 +135,9 @@ class Boooob(ircbot.SingleServerIRCBot): global last_args global last_cmd global reponse + global a_repondu + global pas_reponse + canal = ev.target() personne = ev.source() @@ -201,9 +206,15 @@ class Boooob(ircbot.SingleServerIRCBot): if "Titch" in personne and "leave" in message and "nardco" in message: serv.part(canal) - if reponse is not None and fuzz.ratio(message, reponse) > 60 : - serv.privmsg(canal, personne + " a trouvé la reponse ! Bien joué !") + if reponse is not None and fuzz.ratio(message, reponse) > 60 and personne not in a_repondu: + serv.privmsg(canal, personne + " a trouvé la reponse : {0} ! Bien joué !".format(reponse)) reponse = None + a_repondu = [] + pas_reponse = [] + + if reponse is not None and message in pas_reponse and personne not in a_repondu : + serv.privmsg(canal, "WRONG, {0}".format(personne)) + a_repondu.append(personne) # REDDIT // A COMPLETER @@ -222,7 +233,7 @@ class Boooob(ircbot.SingleServerIRCBot): last_args = args last_cmd = cmd - cmds = ['help', 'ecole', 'ffs', 'thanos', 'chuck', 'roll', 'rateau', 'viieux', 'kohlanta', 'new', 'del', 'get', 'debat', 'pipo', 'np', 'commit', 'zertyy', 'getsub', 'sub', 'delsub', 'addsub', 'reddit'] + cmds = ['help', 'quizz', 'ecole', 'ffs', 'thanos', 'chuck', 'roll', 'rateau', 'viieux', 'kohlanta', 'new', 'del', 'get', 'debat', 'pipo', 'np', 'commit', 'zertyy', 'getsub', 'sub', 'delsub', 'addsub', 'reddit'] most_likely = (cmd, 0) if cmd not in cmds :