From 5a3d3e282a04f495a7f976dc17ac7681548d3d3d Mon Sep 17 00:00:00 2001 From: dupie Date: Fri, 3 Jul 2015 08:31:54 -0400 Subject: [PATCH] bugfixes --- plugins/btc.lua | 5 ++++- plugins/slap.lua | 6 +++--- plugins/weather.lua | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/btc.lua b/plugins/btc.lua index 96b495f..233c134 100644 --- a/plugins/btc.lua +++ b/plugins/btc.lua @@ -28,7 +28,10 @@ function PLUGIN.action(msg) arg1 = string.upper(string.sub(msg.text, 6, 8)) end if string.len(msg.text) > 9 then - arg2 = tonumber(string.sub(msg.text, 10)) + arg2 = string.sub(msg.text, 10) + if not tonumber(arg2) then + return send_msg(msg, 'Invalid argument.') + end end for k,v in pairs(jdat) do diff --git a/plugins/slap.lua b/plugins/slap.lua index 059e4ba..5d2ff39 100644 --- a/plugins/slap.lua +++ b/plugins/slap.lua @@ -105,11 +105,11 @@ function PLUGIN.action(msg) slapper = msg.from.first_name else victim = msg.from.first_name - slapper = 'otouto' + slapper = bot.username end - local message = PLUGIN.getSlap(slapper, victim) - send_message(msg.chat.id, message) + local message = latcyr(PLUGIN.getSlap(slapper, victim)) + send_message(msg.chat.id, latcyr(message)) end diff --git a/plugins/weather.lua b/plugins/weather.lua index 6a5d0ef..1dd9890 100644 --- a/plugins/weather.lua +++ b/plugins/weather.lua @@ -32,7 +32,7 @@ function PLUGIN.action(msg) local celsius = jdat.main.temp - 273.15 local fahrenheit = tonumber(string.format("%.2f", celsius * (9/5) + 32)) - local message = jdat.name .. ': ' .. celsius .. '°C / ' .. fahrenheit .. '°F, ' .. jdat.weather[1].description .. '.' + local message = jdat.name .. ': ' .. celsius .. '°C | ' .. fahrenheit .. '°F, ' .. jdat.weather[1].description .. '.' send_msg(msg, message)