]> gitweb.pimeys.fr Git - bots/basile.git/blobdiff - basile.py
Mise à jour de la méthode de login à NK2015
[bots/basile.git] / basile.py
index 14769c36df39f086feb371bf84601985faf20fdc..e4426ae1d7ac095cf8873ea6259e6207d18c2984 100755 (executable)
--- 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:
@@ -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)