removed yet more left over code from when commands were channel-only.

This commit is contained in:
jesopo 2016-03-31 13:37:08 +01:00
parent 4bca2cb95d
commit 8843d9a469
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3
2 changed files with 6 additions and 8 deletions

View file

@ -157,14 +157,12 @@ class Module(object):
event["target"].last_stdout.send()
def send_stdout(self, event):
if event["target"].name[0] in event["server"].channel_types:
stdout = ChannelStdOut(event["module_name"], event["target"])
stdout = StdOut(event["module_name"], event["target"])
stdout.write(event["message"]).send()
if stdout.has_text():
event["target"].last_stdout = stdout
def send_stderr(self, event):
if event["target"].name[0] in event["server"].channel_types:
stderr = ChannelStdErr(event["module_name"], event["target"])
stderr = StdErr(event["module_name"], event["target"])
stderr.write(event["message"]).send()
if stderr.has_text():
event["target"].last_stderr = stderr

View file

@ -26,14 +26,14 @@ class Module(object):
def postboot_channelset(self, event):
self._postboot_set(self.channel_settings, event)
def _set(self, settings, target, event):
def _set(self, settings, event):
if len(event["args_split"]) > 1:
setting = event["args_split"][0].lower()
if setting in settings:
value = " ".join(event["args_split"][1:])
value = settings[setting]["validate"](value)
if not value == None:
target.set_setting(setting, value)
event["target"].set_setting(setting, value)
event["stdout"].write("Saved setting")
else:
event["stderr"].write("Invalid value")
@ -48,8 +48,8 @@ class Module(object):
self._set(self.settings, event["user"], event)
def channel_set(self, event):
if event["channel"].mode_or_above(event["user"].nickname,
if event["target"].mode_or_above(event["user"].nickname,
"o"):
self._set(self.channel_settings, event["channel"], event)
self._set(self.channel_settings, event)
else:
event["stderr"].write("You do not have the modes required")