aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-09 09:06:17 +0100
committerGravatar jesopo2018-09-09 09:06:17 +0100
commit572ea85f1eb96eb777e4d9a056bb7aa64d5c64f5 (patch)
treeda65509b759f98034a92d25110bb7cfa8f1f4604
parentMerge pull request #19 from dngfx/master (diff)
signature
Better indentation in commands.py
-rw-r--r--modules/commands.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/commands.py b/modules/commands.py
index 2567880b..79631a8c 100644
--- a/modules/commands.py
+++ b/modules/commands.py
@@ -190,14 +190,10 @@ class Module(object):
event["stdout"].write("Commands: %s" % ", ".join(help_available))
def usage(self, event):
+ command_prefix = ""
if event["is_channel"]:
command_prefix = event["target"].get_setting("command-prefix",
- event["server"].get_setting(
- "command-prefix",
- "!"))
- else:
- command_prefix = ""
-
+ event["server"].get_setting("command-prefix", "!"))
command = event["args_split"][0].lower()
if command in self.events.on("received").on(
@@ -205,9 +201,7 @@ class Module(object):
hooks = self.events.on("received").on("command").on(command).get_hooks()
if hooks and "usage" in hooks[0].kwargs:
event["stdout"].write("Usage: %s%s %s" % (command_prefix,
- command,
- hooks[0].kwargs[
- "usage"]))
+ command, hooks[0].kwargs["usage"]))
else:
event["stderr"].write("No usage help available for %s" % command)
else: