changed channel_op.py to not need an argument for (de)op/(de)voice.
This commit is contained in:
parent
c02470ddbf
commit
afc8a72f05
1 changed files with 16 additions and 12 deletions
|
@ -14,17 +14,13 @@ class Module(object):
|
||||||
).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"
|
bot.events.on("received").on("command").on("op"
|
||||||
).hook(self.op, channel_only=True, require_mode="o",
|
).hook(self.op, channel_only=True, require_mode="o")
|
||||||
min_args=1)
|
|
||||||
bot.events.on("received").on("command").on("deop"
|
bot.events.on("received").on("command").on("deop"
|
||||||
).hook(self.deop, channel_only=True, require_mode="o",
|
).hook(self.deop, channel_only=True, require_mode="o")
|
||||||
min_args=1)
|
|
||||||
bot.events.on("received").on("command").on("voice"
|
bot.events.on("received").on("command").on("voice"
|
||||||
).hook(self.voice, channel_only=True, require_mode="o",
|
).hook(self.voice, channel_only=True, require_mode="o")
|
||||||
min_args=1)
|
|
||||||
bot.events.on("received").on("command").on("devoice"
|
bot.events.on("received").on("command").on("devoice"
|
||||||
).hook(self.devoice, channel_only=True, require_mode="o",
|
).hook(self.devoice, 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]
|
||||||
|
@ -58,10 +54,18 @@ class Module(object):
|
||||||
event["stderr"].write("That user is not in this channel")
|
event["stderr"].write("That user is not in this channel")
|
||||||
|
|
||||||
def op(self, event):
|
def op(self, event):
|
||||||
event["target"].send_mode("+o", event["args_split"][0])
|
target = event["user"].nickname if not event["args_split"] else event[
|
||||||
|
"args_split"][0]
|
||||||
|
event["target"].send_mode("+o", target)
|
||||||
def deop(self, event):
|
def deop(self, event):
|
||||||
event["target"].send_mode("-o", event["args_split"][0])
|
target = event["user"].nickname if not event["args_split"] else event[
|
||||||
|
"args_split"][0]
|
||||||
|
event["target"].send_mode("-o", target)
|
||||||
def voice(self, event):
|
def voice(self, event):
|
||||||
event["target"].send_mode("+v", event["args_split"][0])
|
target = event["user"].nickname if not event["args_split"] else event[
|
||||||
|
"args_split"][0]
|
||||||
|
event["target"].send_mode("+v", target)
|
||||||
def devoice(self, event):
|
def devoice(self, event):
|
||||||
event["target"].send_mode("-v", event["args_split"][0])
|
target = event["user"].nickname if not event["args_split"] else event[
|
||||||
|
"args_split"][0]
|
||||||
|
event["target"].send_mode("-v", target)
|
||||||
|
|
Loading…
Reference in a new issue