X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=basile.py;h=e4426ae1d7ac095cf8873ea6259e6207d18c2984;hb=f0cc860eaf72baa51e3838738cb4b1fa44f610c5;hp=51304ed80cc21d1353b4f86a91dea40c1ef3c627;hpb=252d8ac3295648c47acef85083fd424461d834ee;p=bots%2Fbasile.git diff --git a/basile.py b/basile.py index 51304ed..e4426ae 100755 --- a/basile.py +++ b/basile.py @@ -180,7 +180,7 @@ def login_NK(username,password,typ="bdd"): sock=connect_NK() try: # Basile a un compte special user - commande='login [%s,%s,"%s"]'%(json.dumps(username),json.dumps(password),typ) + commande='login [%s,%s,"%s",[["note"],[],false]]'%(json.dumps(username),json.dumps(password),typ) sock.write(commande) out=sock.read() except Exception as exc: @@ -335,7 +335,7 @@ class Basile(ircbot.SingleServerIRCBot): u"bien plein(|e|s|es)":u"bien pleine", u"innocent(|e|s|es)":u"innocente"} adj_reg=u"(?P"+u"|".join(adjectifs.keys())+u")" - reg=u".*(^| )"+debuts+u" "+adj_reg+u"($|,|;|\.| ).*" + reg=u".*(^| |')"+debuts+u" "+adj_reg+u"($|,|;|\.| ).*" matched=re.match(reg,message) if matched: # il faut repasser l'adjectif au féminin singulier @@ -379,7 +379,7 @@ class Basile(ircbot.SingleServerIRCBot): """renvoie (False,lemessage) ou (True, le message amputé de "pseudo: ")""" pseudo=serv.get_nickname() size=len(pseudo) - if message[:size]==pseudo and message[size]==":": + if message[:size]==pseudo and len(message)>size and message[size]==":": return (True,message[size+1:].lstrip(" ")) else: return (False,message)