plugins/version.lua

changeset 37
85b3f2a96edb
parent 33
37caf7bd2021
child 76
cecdfba8e625
--- a/plugins/version.lua	Mon Nov 08 23:06:48 2010 +0100
+++ b/plugins/version.lua	Mon Nov 08 23:19:57 2010 +0100
@@ -10,7 +10,7 @@
 	};
 
 	bot:hook("commands/version", function (command)
-		local who, param = bot.stream.jid, command.param or (command.room and command.room.nick);
+		local who, param = bot.stream.jid, command.param;
 		if param then
 			if command.room and command.room.occupants[param] then
 				who = command.room.occupants[param].jid;
@@ -23,7 +23,7 @@
 		
 		bot.stream:query_version(who, function (reply)
 			if not reply.error then
-				local saywho = (who == command.sender.jid and "You are") or (param.." is");
+				local saywho = (who == command.sender.jid and "You are") or (param and param.." is" or "I am");
 				command:reply(saywho.." running "..(reply.name or "something")
 					.." version "..(reply.version or "unknown")
 					.." on "..(reply.platform or "an unknown platform"));

mercurial