]> gitweb.pimeys.fr Git - bots/basile.git/blobdiff - basile.py
[Compatibilité serveur NK] Le masque contient maintenant les droits qu'on ne veut...
[bots/basile.git] / basile.py
index 374a594013f0e223fcabff41f823d1b2ff6a53fb..610a34609e65d374d875e1a315a1ef8a97965e4b 100755 (executable)
--- a/basile.py
+++ b/basile.py
@@ -23,7 +23,7 @@ import ircbot
 from commands import getstatusoutput as ex
 
 # on récupère la config
-import config_basile as config
+import config
 
 # la partie qui réfère au fichier lui-même est mieux ici
 # sinon on réfère la config et pas le fichier lui-même
@@ -92,9 +92,9 @@ 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"]'
+        masque='[]'
     elif typ=="bdd":
-        masque='[["all"],["all"],false]'
+        masque='[[], [], true]'
     try:
         # Basile a un compte special user
         commande='login [%s,%s,"%s",%s]'%(json.dumps(username),json.dumps(password),typ,masque)
@@ -237,8 +237,6 @@ class Basile(ircbot.SingleServerIRCBot):
         log(self.serveur,"Connected")
         if self.debug:
             self.chanlist=["#bot"]
-        else:
-            serv.privmsg("ChanServ", "INVITE #note-dev")
         for c in self.chanlist:
             log(self.serveur,"JOIN %s"%(c))
             serv.join(c)
@@ -889,7 +887,9 @@ def main():
         exit(1)
     serveur=sys.argv[1]
     if "--daemon" in sys.argv:
-        os.chdir("/home/basile/basile")
+        thisfile = os.path.realpath(__file__)
+        thisdirectory = thisfile.rsplit("/", 1)[0]
+        os.chdir(thisdirectory)
         daemon = True
     else:
         daemon = False