From 093fc5b2a8820031149f3eba8f4a2ab73f9ac3fc Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 8 Nov 2018 17:48:23 +0000 Subject: [PATCH] Make hiding [Github] prefix dependent on channel setting --- modules/github.py | 8 ++++++-- 1 file 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 = []