diff --git a/nardco.py b/nardco.py index 42ab5b4496902dd14105a1251e77c975fa48b350..cd5a662c625a9c66f5214f5809dd22fad153a7ed 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 :