don't use full event names to check what command we're in
This commit is contained in:
parent
bad108d7ce
commit
7fbb5b2823
3 changed files with 5 additions and 5 deletions
|
@ -125,7 +125,7 @@ class Module(ModuleManager.BaseModule):
|
|||
@utils.kwarg("require_access", "op")
|
||||
@utils.kwarg("usage", "[nickname]")
|
||||
def op(self, event):
|
||||
add = event.name == "received.command.op"
|
||||
add = event["command"] == "op"
|
||||
target = event["args_split"][0] if event["args"] else event[
|
||||
"user"].nickname
|
||||
event["target"].send_mode("+o" if add else "-o", target)
|
||||
|
@ -137,7 +137,7 @@ class Module(ModuleManager.BaseModule):
|
|||
@utils.kwarg("require_access", "voice")
|
||||
@utils.kwarg("usage", "[nickname]")
|
||||
def voice(self, event):
|
||||
add = event.name == "received.command.voice"
|
||||
add = event["command"] == "voice"
|
||||
target = event["args_split"][0] if event["args"] else event[
|
||||
"user"].nickname
|
||||
event["target"].send_mode("+v" if add else "-v", target)
|
||||
|
@ -184,7 +184,7 @@ class Module(ModuleManager.BaseModule):
|
|||
@utils.kwarg("require_access", "mute")
|
||||
@utils.kwarg("help", "Mute a given user")
|
||||
def _mute(self, event):
|
||||
add = event.name == "received.command.mute"
|
||||
add = event["command"] == "mute"
|
||||
time, args = self._parse_time(event["args_split"], 1)
|
||||
|
||||
target_name = args[0]
|
||||
|
|
|
@ -99,7 +99,7 @@ class Module(ModuleManager.BaseModule):
|
|||
@utils.kwarg("require-mode", "o")
|
||||
@utils.kwarg("require-access", "cignore")
|
||||
def cignore(self, event):
|
||||
remove = event.name == "received.command.cunignore"
|
||||
remove = event["command"] == "cunignore"
|
||||
|
||||
target_user = event["server"].get_user(event["args_split"][0])
|
||||
is_ignored = event["target"].get_user_setting(target_user.get_id(),
|
||||
|
|
|
@ -96,7 +96,7 @@ class Module(ModuleManager.BaseModule):
|
|||
@utils.kwarg("min_args", 1)
|
||||
@utils.kwarg("usage", "<target>")
|
||||
def changepoint(self, event):
|
||||
positive = event.name == "received.command.addpoint"
|
||||
positive = event["command"] == "addpoint"
|
||||
success, message = self._karma(event["server"], event["user"],
|
||||
event["args"].strip(), positive)
|
||||
event["stdout" if success else "stderr"].write(message)
|
||||
|
|
Loading…
Reference in a new issue