Skip to content
Extraits de code Groupes Projets
Valider cd8133fe rédigé par Loris TICHADOU's avatar Loris TICHADOU
Parcourir les fichiers

Update nardco.py

parent f599c67f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -58,6 +58,8 @@ cmdCarac = "$" ...@@ -58,6 +58,8 @@ cmdCarac = "$"
personnalizedCmd = {} personnalizedCmd = {}
reponse = None reponse = None
pas_reponse = []
a_repondu = []
def isCommande(string): def isCommande(string):
global cmdCarac global cmdCarac
...@@ -133,6 +135,9 @@ class Boooob(ircbot.SingleServerIRCBot): ...@@ -133,6 +135,9 @@ class Boooob(ircbot.SingleServerIRCBot):
global last_args global last_args
global last_cmd global last_cmd
global reponse global reponse
global a_repondu
global pas_reponse
canal = ev.target() canal = ev.target()
personne = ev.source() personne = ev.source()
...@@ -201,9 +206,15 @@ class Boooob(ircbot.SingleServerIRCBot): ...@@ -201,9 +206,15 @@ class Boooob(ircbot.SingleServerIRCBot):
if "Titch" in personne and "leave" in message and "nardco" in message: if "Titch" in personne and "leave" in message and "nardco" in message:
serv.part(canal) serv.part(canal)
if reponse is not None and fuzz.ratio(message, reponse) > 60 : 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 ! Bien joué !") serv.privmsg(canal, personne + " a trouvé la reponse : {0} ! Bien joué !".format(reponse))
reponse = None 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 # REDDIT // A COMPLETER
...@@ -222,7 +233,7 @@ class Boooob(ircbot.SingleServerIRCBot): ...@@ -222,7 +233,7 @@ class Boooob(ircbot.SingleServerIRCBot):
last_args = args last_args = args
last_cmd = cmd 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) most_likely = (cmd, 0)
if cmd not in cmds : if cmd not in cmds :
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter