From: Vincent Le Gallic Date: Tue, 20 Oct 2015 01:54:04 +0000 (+0200) Subject: Commandes OP et DEOP en privmsg X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=bots%2Fbbc.git Commandes OP et DEOP en privmsg --- diff --git a/bbc.py b/bbc.py index 67b6101..c69123c 100755 --- 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: