From 71019cda4d0ff08890f5a73dc1eb48fd9161e1a7 Mon Sep 17 00:00:00 2001 From: Loris TICHADOU <loris.tichadou@ensiie.fr> Date: Thu, 2 May 2019 17:08:46 +0200 Subject: [PATCH] Update nardco.py --- nardco.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nardco.py b/nardco.py index 94d72e2..0b75095 100755 --- a/nardco.py +++ b/nardco.py @@ -201,7 +201,7 @@ 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 reponse in message : + if reponse is not None and fuzz.ratio(message, reponse) > 60 : serv.privmsg(canal, personne + " a trouvé la reponse ! Bien joué !") reponse = None @@ -256,7 +256,8 @@ class Boooob(ircbot.SingleServerIRCBot): reponse = datas['reponse'].lower() choix = datas['choix'] question= datas['question'] - serv.privmsg(canal, "Question : {0}, Choix : {1}".format(question.format('utf8'), ', '.join(choix).format('utf8'))) + serv.privmsg(canal, "Question : {0}".format(question.format('utf8')) + serv.privmsg(canal, "Choix: {0}".format(', '.join(choix).format('utf8'))) elif cmd == "ecole" : try : -- GitLab