From: Vincent Le Gallic <legallic@crans.org>
Date: Sat, 30 Jun 2012 22:48:14 +0000 (+0200)
Subject: Possibilité de reload la config sur demande
X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=65e735f0782a5afceaf6a8318761f3d4a17a2515;p=bots%2Fbasile.git

Possibilité de reload la config sur demande
---

diff --git a/basile.py b/basile.py
index 011dc56..92dcbcc 100755
--- a/basile.py
+++ b/basile.py
@@ -290,6 +290,8 @@ class Basile(ircbot.SingleServerIRCBot):
  Me fait perdre sur le channel.""",None],
  "reconnect": [None,"""RECONNECT
  Établit à nouveau la connexion avec le serveur NK2015""",None],
+ "reload": [None,"""RELOAD
+ Recharge la configuration.""",None],
  "say": [None,None,"""SAY <channel> <message>
  Me fait parler sur le channel."""],
  "do": [None,None,"""DO <channel> <action>
@@ -308,7 +310,7 @@ class Basile(ircbot.SingleServerIRCBot):
  Me déconnecte du serveur IRC."""]
  }
             helpmsg_default="Liste des commandes disponibles :\nHELP IDENTIFY DROP SOLDE"
-            helpmsg_ops=" JOIN LEAVE QUIET NOQUIET LOST RECONNECT"
+            helpmsg_ops=" JOIN LEAVE QUIET NOQUIET LOST RECONNECT RELOAD"
             helpmsg_overops=" SAY DO STAY NOSTAY OPS OVEROPS KICK DIE"
             op,overop=auteur in self.ops, auteur in self.overops
             if len(message)==1:
@@ -430,6 +432,12 @@ class Basile(ircbot.SingleServerIRCBot):
                 self.mourir()
             else:
                 notunderstood=True
+        elif cmd=="reload":
+            if auteur in self.ops:
+                reload(config)
+                serv.privmsg(auteur,"done")
+            else:
+                notunderstood=True
         elif cmd=="reconnect":
             if auteur in self.ops:
                 try: