plugins/ping.lua

changeset 16
ae69cea97598
parent 4
1eaa469140e9
child 105
4234c8789cc6
--- a/plugins/ping.lua	Thu May 20 14:33:09 2010 +0100
+++ b/plugins/ping.lua	Thu May 20 14:33:41 2010 +0100
@@ -2,17 +2,17 @@
 function riddim.plugins.ping(bot)
 	bot.stream:add_plugin("ping");
 	bot:hook("commands/ping", function (command)
-			local jid = command.param;
-			if jid then
-				bot.stream:ping(jid, function (time, jid, error)
-					if time then
-						command:reply(string.format("Pong from %s in %0.3f seconds", jid, time));
-					else
-						command:reply("Ping failed ("..(error.condition or "unknown reason")..")"..(error.text and (": "..error.text) or ""));
-					end
-				end);
-				return true;
-			end
-			return "pong";
-		end);
+		local jid = command.param;
+		if jid then
+			bot.stream:ping(jid, function (time, jid, error)
+				if time then
+					command:reply(string.format("Pong from %s in %0.3f seconds", jid, time));
+				else
+					command:reply("Ping failed ("..(error.condition or "unknown reason")..")"..(error.text and (": "..error.text) or ""));
+				end
+			end);
+			return true;
+		end
+		return "pong";
+	end);
 end

mercurial