From 498352d1acf9141d536091ae415cc196d051719c Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 3 Jan 2019 21:18:40 +0000 Subject: Support adding github webhooks for an entire "username" (github.py) --- modules/github.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/github.py') diff --git a/modules/github.py b/modules/github.py index 32536dff..06fbdae6 100644 --- a/modules/github.py +++ b/modules/github.py @@ -47,6 +47,7 @@ class Module(ModuleManager.BaseModule): return "" full_name = data["repository"]["full_name"] + repo_username, repo_name = full_name.split("/", 1) hooks = self.bot.database.channel_settings.find_by_setting( "github-hook") targets = [] @@ -54,7 +55,7 @@ class Module(ModuleManager.BaseModule): repo_hooked = False for i, (server_id, channel_name, hooked_repos) in list( enumerate(hooks))[::-1]: - if full_name in hooked_repos: + if repo_username in hooked_repos or full_name in hooked_repos: repo_hooked = True server = self.bot.get_server(server_id) if server and channel_name in server.channels: -- cgit v1.3.1-10-gc9f91