aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-08 17:48:23 +0000
committerGravatar jesopo2018-11-08 17:48:23 +0000
commit093fc5b2a8820031149f3eba8f4a2ab73f9ac3fc (patch)
tree40e0e4481abeb16e776e2d220d8952351f2b887d
parentAdd missing ".get(" in modules/resume.py (diff)
signature
Make hiding [Github] prefix dependent on channel setting
-rw-r--r--modules/github.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/github.py b/modules/github.py
index e34ced4b..ecbbff51 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -11,7 +11,10 @@ COMMENT_ACTIONS = {
@utils.export("channelset", {"setting": "github-hook",
"help": ("Disable/Enable showing BitBot's github commits in the "
- "current channel"), "hidden": True})
+ "current channel")})
+@utils.export("channelset", {"setting": "github-hide-prefix",
+ "help": "Hide/show command-like prefix on Github hook outputs",
+ "validate": utils.bool_or_none})
class Module(ModuleManager.BaseModule):
@utils.hook("api.post.github")
def github(self, event):
@@ -59,7 +62,8 @@ class Module(ModuleManager.BaseModule):
def _make_trigger(self, channel, server, line):
return lambda: self.events.on("send.stdout").call(target=channel,
- module_name="Github", server=server, message=line, hide_prefix=True)
+ module_name="Github", server=server, message=line,
+ hide_prefix=channel.get_setting("github-hide-prefix", False))
def push(self, event, full_name, data):
outputs = []