From 3aa337860b23e7e69721a4ac338a14bf32334275 Mon Sep 17 00:00:00 2001 From: Loris TICHADOU <loris.tichadou@ensiie.fr> Date: Thu, 2 May 2019 15:21:49 +0200 Subject: [PATCH] Update nardco.py --- nardco.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nardco.py b/nardco.py index 42ab5b4..cd5a662 100755 --- a/nardco.py +++ b/nardco.py @@ -18,6 +18,7 @@ import nordpresse import commit import kohlanta from ensiee import ensiee +from quizz import quizz # import rateau def couper(pseudo): @@ -56,6 +57,7 @@ global cmdCarac cmdCarac = "$" personnalizedCmd = {} +reponse = None def isCommande(string): global cmdCarac @@ -130,6 +132,7 @@ class Boooob(ircbot.SingleServerIRCBot): global personnalizedCmd global last_args global last_cmd + global reponse canal = ev.target() personne = ev.source() @@ -198,6 +201,10 @@ class Boooob(ircbot.SingleServerIRCBot): if "Titch" in personne and "leave" in message and "nardco" in message: serv.part(canal) + if reponse is not None && reponse in message : + serv.privmsg(canal, personne + " a trouvé la reponse ! Bien joué !") + reponse = None + # REDDIT // A COMPLETER if isCommande(message): @@ -244,6 +251,13 @@ class Boooob(ircbot.SingleServerIRCBot): else: serv.privmsg(canal, ("Commandes disponibles :{0}").format(', '.join(cmds))) + elif cmd == "quizz" : + datas = quizz() + reponse = datas['reponse'] + choix = datas['choix'] + question= datas['reponse'] + serv.privmsg(canal, "Question : {0}, Choix : {1}".format(question, ', '.join(choix))) + elif cmd == "ecole" : try : -- GitLab