aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-13 09:16:22 +0100
committerGravatar jesopo2018-10-13 09:16:22 +0100
commit381b00f2cdc90ac6b6ad0c772cf2662d95aa1989 (patch)
tree13371230202cc216875e667292b750b31007796d
parentActually, don't give contexts to timers that aren't contextual. (e.g. pesistent (diff)
signature
Only get list of github-hook channels once
-rw-r--r--modules/github.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/github.py b/modules/github.py
index aaeaaa33..20209c29 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -16,7 +16,8 @@ class Module(ModuleManager.BaseModule):
if "commits" in data:
full_name = data["repository"]["full_name"]
-
+ hooks = self.bot.database.channel_settings.find_by_setting(
+ "github-hook")
for commit in data["commits"]:
id = commit["id"]
@@ -33,8 +34,6 @@ class Module(ModuleManager.BaseModule):
line = ("(%s) [files: +%d ∆%d -%d] commit by '%s': %s"
% (full_name, added_count, modified_count,
removed_count, author, message))
- hooks = self.bot.database.channel_settings.find_by_setting(
- "github-hook")
hooks = [hook for hook in hooks if hook[2]]
for server_id, channel_name, _ in hooks:
server = self.bot.get_server(server_id)