Make hiding [Github] prefix dependent on channel setting

This commit is contained in:
jesopo 2018-11-08 17:48:23 +00:00
parent 2b106adc05
commit 093fc5b2a8

View file

@ -11,7 +11,10 @@ COMMENT_ACTIONS = {
@utils.export("channelset", {"setting": "github-hook", @utils.export("channelset", {"setting": "github-hook",
"help": ("Disable/Enable showing BitBot's github commits in the " "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): class Module(ModuleManager.BaseModule):
@utils.hook("api.post.github") @utils.hook("api.post.github")
def github(self, event): def github(self, event):
@ -59,7 +62,8 @@ class Module(ModuleManager.BaseModule):
def _make_trigger(self, channel, server, line): def _make_trigger(self, channel, server, line):
return lambda: self.events.on("send.stdout").call(target=channel, 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): def push(self, event, full_name, data):
outputs = [] outputs = []