# HG changeset patch # User Kim Alvefur # Date 1436475142 -7200 # Node ID 99781a97f5825326833cae0f0d56a160627e933d # Parent 2c570064f582403ca55bfd863252bacca1526d4e plugins.version: Don't include unknown version or platform in reply diff -r 2c570064f582 -r 99781a97f582 plugins/version.lua --- a/plugins/version.lua Thu Jul 09 22:48:55 2015 +0200 +++ b/plugins/version.lua Thu Jul 09 22:52:22 2015 +0200 @@ -26,9 +26,14 @@ bot.stream:query_version(who, function (reply) if not reply.error then 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")); + local isrunning = saywho.." running "..(reply.name or "something"); + if reply.version then + isrunning = isrunning .." version "..reply.version; + end + if reply.platform then + isrunning = isrunning .." on "..reply.platform; + end + command:reply(isrunning); else local type, condition, text = reply.type, reply.condition, reply.text; local r = "There was an error requesting "..param.."'s version";