Diff

mod_slack_webhooks/mod_slack_webhooks.lua @ 3148:8c7b8b2c3237

mod_slack_webhooks: Add a special webhook target for debugging
author Kim Alvefur <zash@zash.se>
date Sun, 03 Jun 2018 02:18:02 +0200
parent 3147:82689acd1294
child 3443:284d8c18060e
line wrap: on
line diff
--- a/mod_slack_webhooks/mod_slack_webhooks.lua	Sun Jun 03 02:02:56 2018 +0200
+++ b/mod_slack_webhooks/mod_slack_webhooks.lua	Sun Jun 03 02:18:02 2018 +0200
@@ -90,6 +90,10 @@
 	json_out = json.encode(json_out)
 	local url = routing[from_room];
 	module:log("debug", "message from %s in %s to %s", from_nick, from_room, url);
+	if url == "DEBUG" then
+		module:log("debug", "json_out = %s", json_out);
+		return;
+	end
 	local headers = {
 		["Content-Type"] = "application/json",
 	};