]> gitweb.pimeys.fr Git - bots/bbc.git/commitdiff
Commandes OP et DEOP en privmsg master
authorVincent Le Gallic <legallic@crans.org>
Tue, 20 Oct 2015 01:54:04 +0000 (03:54 +0200)
committerVincent Le Gallic <legallic@crans.org>
Tue, 20 Oct 2015 01:54:04 +0000 (03:54 +0200)
bbc.py

diff --git a/bbc.py b/bbc.py
index 67b610130cd7b31bf10030a8a94564259f9972c4..c69123c94033758e746f904a43bfdf9c4d1c5d73 100755 (executable)
--- a/bbc.py
+++ b/bbc.py
@@ -242,6 +242,26 @@ class Bbc(ircbot.SingleServerIRCBot):
                 serv.privmsg(auteur, " ".join(self.overops))
             else:
                 notunderstood = True
+        elif cmd == "op":
+            if auteur in self.overops:
+                if len(message) > 2:
+                    serv.mode(message[1], "+o %s" % message[2])
+                elif len(message) > 1:
+                    serv.mode(message[1], "+o %s" % auteur)
+                else:
+                    serv.privmsg(auteur, config.helpdico["op"][2])
+            else:
+                notunderstood = True
+        elif cmd == "deop":
+            if auteur in self.overops:
+                if len(message) > 2:
+                    serv.mode(message[1], "-o %s" % message[2])
+                elif len(message) > 1:
+                    serv.mode(message[1], "-o %s" % auteur)
+                else:
+                    serv.privmsg(auteur, config.helpdico["deop"][2])
+            else:
+                notunderstood = True
         else:
             notunderstood = True
         if notunderstood: