]> gitweb.pimeys.fr Git - bots/basile.git/blobdiff - basile.py
cafouillage sur les masque special/bdd au login
[bots/basile.git] / basile.py
index e4426ae1d7ac095cf8873ea6259e6207d18c2984..f92fe673855077abf151c54ddf6bc5c1f30c9c54 100755 (executable)
--- a/basile.py
+++ b/basile.py
@@ -178,9 +178,13 @@ def connect_NK():
 
 def login_NK(username,password,typ="bdd"):
     sock=connect_NK()
+    if typ=="special": # ça c'est pour Basile lui-même
+        masque='["note"]'
+    elif typ=="bdd":
+        masque='[["all"],["all"],false]'
     try:
         # Basile a un compte special user
-        commande='login [%s,%s,"%s",[["note"],[],false]]'%(json.dumps(username),json.dumps(password),typ)
+        commande='login [%s,%s,"%s",%s]'%(json.dumps(username),json.dumps(password),typ,masque)
         sock.write(commande)
         out=sock.read()
     except Exception as exc:
@@ -602,9 +606,10 @@ class Basile(ircbot.SingleServerIRCBot):
         try:
             test=bot_unicode(message)
         except UnicodeBotError:
-            serv.privmsg(canal,
-              "%s: Euh, tu fais de la merde avec ton encodage là, j'ai failli crasher…"%(auteur))
-            return
+            if not canal in self.quiet_channels:
+                serv.privmsg(canal,
+                  "%s: Euh, tu fais de la merde avec ton encodage là, j'ai failli crasher…"%(auteur))
+                return
         pour_moi,message=self.pourmoi(serv,message)
         if pour_moi and message.split()!=[]:
             cmd=message.split()[0].lower()