added deop, voice and devoice to channel_op.py.

This commit is contained in:
jesopo 2016-05-17 14:51:47 +01:00
parent 2fb299e9b7
commit 8dadd7d339
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3

View file

@ -16,6 +16,15 @@ class Module(object):
bot.events.on("received").on("command").on("op"
).hook(self.op, channel_only=True, require_mode="o",
min_args=1)
bot.events.on("received").on("command").on("deop"
).hook(self.deop, channel_only=True, require_mode="o",
min_args=1)
bot.events.on("received").on("command").on("voice"
).hook(self.voice, channel_only=True, require_mode="o",
min_args=1)
bot.events.on("received").on("command").on("devoice"
).hook(self.devoice, channel_only=True, require_mode="o",
min_args=1)
def kick(self, event):
target = event["args_split"][0]
@ -50,3 +59,9 @@ class Module(object):
def op(self, event):
event["target"].send_mode("+o", event["args_split"][0])
def deop(self, event):
event["target"].send_mode("-o", event["args_split"][0])
def voice(self, event):
event["target"].send_mode("+v", event["args_split"][0])
def devoice(self, event):
event["target"].send_mode("-v", event["args_split"][0])