added an op command to channel_op.py.

This commit is contained in:
jesopo 2016-04-22 11:48:28 +01:00
parent 5e9574e195
commit 00dd425210
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3

View file

@ -13,6 +13,9 @@ class Module(object):
bot.events.on("received").on("command").on("kickban", "kb" bot.events.on("received").on("command").on("kickban", "kb"
).hook(self.kickban, channel_only=True, require_mode="o", ).hook(self.kickban, channel_only=True, require_mode="o",
min_args=1) min_args=1)
bot.events.on("received").on("command").on("op"
).hook(self.op, channel_only=True, require_mode="o",
min_args=1)
def kick(self, event): def kick(self, event):
target = event["args_split"][0] target = event["args_split"][0]
@ -42,3 +45,6 @@ class Module(object):
if event["server"].has_user(event["args_split"][0]): if event["server"].has_user(event["args_split"][0]):
self.ban(event) self.ban(event)
self.kick(event) self.kick(event)
def op(self, event):
event["target"].send_mode("+o", event["args_split"][0])