plugins/ping.lua

Mon, 21 Dec 2009 19:27:08 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 21 Dec 2009 19:27:08 +0000
changeset 0
7d84f4403d67
child 4
1eaa469140e9
permissions
-rw-r--r--

Initial commit, hello world!


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)
					command:reply(string.format("Pong from %s in %0.3f seconds", jid, time));
				end);
				return true;
			end
			return "pong";
		end);
end

mercurial