mod_slack_webhooks: Add a special webhook target for debugging
authorKim Alvefur <zash@zash.se>
Sun, 03 Jun 2018 02:18:02 +0200
changeset 3152 8c7b8b2c3237
parent 3151 82689acd1294
child 3153 ccbfe7df02dc
mod_slack_webhooks: Add a special webhook target for debugging
mod_slack_webhooks/mod_slack_webhooks.lua
--- 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",
 	};