X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=Salesman.py;h=1dd5b366c07f030647c91bcf8c38f33e528b8d1d;hb=c9af793ee915f3138712e9c3b31283ef3a5f679e;hp=53409b5bf36bbe64d2f4aac04f1feb82f2548d52;hpb=9e241c20b52796885703f9cba0fb67f0fbc3d06b;p=bots%2Fsalesman.git diff --git a/Salesman.py b/Salesman.py index 53409b5..1dd5b36 100755 --- a/Salesman.py +++ b/Salesman.py @@ -82,7 +82,7 @@ def reussi(message,answer,auteur): if auteur in config_level2: return remplace_accents(answer) in message else: - if re.match(remplace_accents(answer).lower(),remplace_accents(message).lower()): + if re.match(".*"+remplace_accents(answer).lower(),remplace_accents(message).lower()): return True def is_something(chain,matches,avant=u".*(?:^| )",apres=u"(?:$|\.| |,|;).*",case_sensitive=False,debug=False): @@ -169,7 +169,7 @@ class Salesman(ircbot.SingleServerIRCBot): def get_enigme(self): # on récupère les capitales f=open(config_source_file) - l=f.readlines() + l=[i.strip("\n") for i in f.readlines()] f.close() l=[i.split(" | ") for i in l] dec={int(i[0]):list(i[1:]) for i in l}