This commit is contained in:
dupie 2015-07-03 08:31:54 -04:00
parent 7dd198421a
commit 5a3d3e282a
3 changed files with 8 additions and 5 deletions

View File

@ -28,7 +28,10 @@ function PLUGIN.action(msg)
arg1 = string.upper(string.sub(msg.text, 6, 8)) arg1 = string.upper(string.sub(msg.text, 6, 8))
end end
if string.len(msg.text) > 9 then 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 end
for k,v in pairs(jdat) do for k,v in pairs(jdat) do

View File

@ -105,11 +105,11 @@ function PLUGIN.action(msg)
slapper = msg.from.first_name slapper = msg.from.first_name
else else
victim = msg.from.first_name victim = msg.from.first_name
slapper = 'otouto' slapper = bot.username
end end
local message = PLUGIN.getSlap(slapper, victim) local message = latcyr(PLUGIN.getSlap(slapper, victim))
send_message(msg.chat.id, message) send_message(msg.chat.id, latcyr(message))
end end

View File

@ -32,7 +32,7 @@ function PLUGIN.action(msg)
local celsius = jdat.main.temp - 273.15 local celsius = jdat.main.temp - 273.15
local fahrenheit = tonumber(string.format("%.2f", celsius * (9/5) + 32)) 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) send_msg(msg, message)